The efficient separation of photoinduced charge carriers is a primary factor in the catalytic performance of photocatalysts. Constructing S-scheme heterojunctions is a prospective strategy to efficiently and spatially separate photoinduced charges while retaining strong oxidation and reduction capacities of the catalyst system. Herein, CoTiO3/MgIn2S4 (abbreviated x% CTO/MIS, where x% represents the mass ratio of CTO-to-MIS; x = 5, 10, 15, 20, and 25) heterojunctions were successfully synthesized using a hydrothermal method. These heterojunctions exhibited highly efficient and reusable visible-light photocatalytic properties for hydrogen (H2) generation and formaldehyde (HCHO) degradation. Notably, the 15 % CTO/MIS demonstrated an admirable H2 evolution activity of 631.77 μmol·g−1·h−1, with AQE = 2.25 % at λ = 420 nm, and an HCHO degradation rate of 67.18 %. The intermediate products generated during HCHO removal were identified applying in situ diffuse reflectance infrared Fourier transform spectroscopy. The exceptional catalytic performance of the synthesized materials was attributed to the boosted light absorption and utilization, rapidly separation, and transfer of photoproduced charge carriers, which resulted from the internal electric field of the S-scheme mechanism. Moreover, the S-scheme electron transfer pathway for the CTO/MIS catalyst system during the photocatalytic process was confirmed using electron spin resonance spectroscopy, free-radical capturing tests, density functional theory calculations, in situ X-ray photoelectron spectroscopy, and semiconductor energy band theory. The study offers an innovative perspective for establishing S-scheme heterojunctions with highly efficient and stable photocatalytic activity for H2 generation and HCHO removal.