In this paper, an S-type NCN/CdS heterojunction was formed by anchoring cadmium sulfide on nitrogen-doped carbon quantum dot-modified g-C3N4 (abbreviated as NCN) via hydrothermal and calcination methods. The bifunctional properties of NCN/CdS for the detection and degradation of antibiotics [tetracycline (TC) and chlortetracycline (CTC)] were demonstrated. The S-type heterojunction has a strong redox capacity and effectively separates photogenerated e−-h+ pairs, which improves photocatalytic performance. NCDs is located between cadmium sulfide and g-C3N4, which forms a charge-transport channel that accelerates the carrier transport between the interfaces of the S-type heterojunction. Good photocatalytic performance (TC: 98.0 % for 45 min; CTC: 100 % for 70 min) and excellent cycling stability were obtained. This study provides a new strategy for designing efficient, stable and bifunctional materials for environmental pollution treatment.