This work used a one-step calcination process to prepare g-C3N4 composites with varying Y2O3 loading. XRD, TEM, and XPS verified the structure and morphology of the composite photocatalyst, and its photoelectrochemical and hydrogen production performance were studied. According to the experimental results, it is found that the composite structure between Y2O3 and g-C3N4 effectively suppresses the photoelectron–hole complex and enhances the photocatalytic hydrogen production properties of g-C3N4. Under the irradiation of a 300 W xenon lamp, YCN-3 had superior photocatalytic hydrogen generation performance, achieving a rate of 1079.61 μmol g−1 h−1, which was 2.3 times greater than that of g-C3N4 in its unmodified state. After three consecutive photocatalytic operations, satisfactory stability and reusability were obtained. Finally, the possibility of a mechanism for the photocatalytic charge transfer pathway is discussed, which provides an effective way for g-C3N4 photocatalytic hydrogen production.