This study investigated a ternary CdS/TiO 2 /g-C 3 N 4 heterojunction for degrading synthetic dyes and hydrogen production from aqueous media through visible light-initiated photocatalytic reactions. CdS, TiO 2 , and g-C 3 N 4 were combined in different mass ratios through a simple hydrothermal method to create CdS/TiO 2 / g-C 3 N 4 composite photocatalysts. The prepared heterojunction catalysts were investigated by using FTIR, XRD, EDX, SEM, and UV−visible spectroscopy analysis for their crystal structures, functional groups, elemental composition, microtopography, and optical properties. The rhodamine B dye was then degraded by using fully characterized photocatalysts. The maximum dye degradation efficiency of 99.4% was noted in these experiments. The evolution rate of hydrogen from the aqueous solution with the CdS/TiO 2 /g-C 3 N 4 photocatalyst remained 2910 μmol• h −1 •g −1 , which is considerably higher than those of g-C 3 N 4 , CdS, CdS/g-C 3 N 4 , and g-C 3 N 4 /TiO 2 -catalyzed reactions. This study also proposes a photocatalytic activity mechanism for the tested ternary CdS/TiO 2 /g-C 3 N 4 heterojunctions.