Photocatalytic hydrogen peroxide (H2O2) production (PHP) using solar energy exhibits remarkable advantages of environmental friendliness and a lack of pollution compared to the current anthraquinone method, however the production efficiency of PHP is limited by the rapid recombination of photogenerated carriers. In this study, we successfully synthesized a resorcinol-formaldehyde resin/Cd3(C3N3S3)2 (RF/CdTMT) S-scheme heterojunction photocatalyst via the oil bath method to enhance PHP. A series of characterization tests confirm the successful construction of an S-scheme heterojunction which enhances the separation efficiency of photogenerated carriers. Through X-ray photoelectron spectroscopy (XPS) and density functional theory (DFT) calculations the charge transfer mechanism of the S-scheme heterojunction is confirmed. In pure water, the photocatalytic H2O2 production performance of the composite is significantly enhanced: 15.15 times that of the single catalyst CdTMT and 3.01 times that of the RF, with excellent cycling stability. This study confirms that the S-scheme heterojunction can effectively suppress the recombination of photogenerated carriers, thereby enhancing the efficiency of photocatalytic reactions and providing new insights for efficient photocatalytic H2O2 production.