Herein, Ti3C2Tx MXene was prepared and used to anchor CdS nanoparticles, and CdS/Ti3C2Tx (CT) photocatalyst with an interfacial Schottky junction was obtained for in situ hydrogen peroxide (H2O2) production to degrade emerging contaminants. CT-0.5 photocatalyst had the highest H2O2 production yield, which was 401 μmol L–1 within 1 h in pure water without organic sacrificial reagents under visible-light irradiation (λ > 420 nm), more than 3 times that of pristine CdS. The excellent photocatalytic performance was attributed to the unique properties of Ti3C2Tx and the formed Schottky junction, which accelerated electron transfer and spatial charge separation. The introduction of Ti3C2Tx improved the selectivity of two-electron O2 reduction, and the direct one-step two-electron O2 reduction route dominated the overall O2 reduction process for H2O2 production. Finally, CT-0.5 was applied to construct a photo-Fenton system, which also exhibited a superior catalytic performance and wide suitability for degrading emerging contaminants, suggesting its environmental significance.