CdS, as an important photocatalytic degradation material, exhibits certain limitations. In our study, carbon nitride/cadmium sulfide (C3N5/CdS) nanocomposites were synthesized via an in-situ method, and the crystalline structure, composition, and morphology of the hybrid samples were evaluated using various techniques. The development of the Z-scheme heterojunction in the C3N5/CdS composite photocatalyst facilitated more effective separation of photogenerated charges, resulting in higher photocatalytic degradation efficiency. Under visible light irradiation at 425 nm, the composite with a 1:1 ratio exhibited the best degradation performance, achieving degradation rates of 93.8% for methyl orange solution and 96.8% for rhodamine B solution. Additionally, the introduction of C3N5 significantly reduced the photocorrosion of CdS. These experimental results were confirmed by fluorescence analysis, surface photovoltage (SPV) measurements, electrochemical tests, etc.