Graphitic carbon nitride (g-C3N4) faces limitations in its photocatalytic applications due to its inherently wide bandgap (2.7 eV), low utilization of visible light, and a high rate of recombination of photogenerated electron-hole pairs. Defect engineering can effectively enhance the ability of g-C3N4 photocatalysts to address environmental pollution. In this paper, g-C3N4 materials with N defects (AA-CN15) were successfully prepared by using urea as a hydrogen bond donor and ammonium acetate as a hydrogen bond acceptor. The catalyst exhibits a wider range of visible light absorption, a lower rate of photogenerated electron-hole recombination, and a larger specific surface area, thanks to the formation of N defects in the N1 (C = N-C) vacancy. The formation of N defects reduces the band gap width of AA-CN15 from 2.85 eV to 1.90 eV compared to U-CN. The degradation rate of AA-CN15 in a 30 mg/L MB solution under visible light irradiation can reach 91.4% within 100 minutes, which is 7.2 times higher than that of U-CN. This study addresses the limitations and drawbacks of traditional defect introduction methods, offering a novel approach for the synthesis of N-defect g-C3N4 materials.