Antibiotic overuse raises environmental concerns, boosting the demand for efficient removal from pharmaceutical wastewater. Photocatalysis, particularly using semiconductor photocatalysts, offers a promising solution and garners significant scientific interest. In this study, a cyanamide defective carbon nitride (KCN) and Bi2WO6(BWO) 2 WO 6 (BWO) heterojunction photocatalyst (2-BWO@KCN) was developed, analyzed, and employed for the photocatalytic degradation of tetracycline hydrochloride (TC) under visible light. The as-synthesized heterojunction 2-BWO@KCN sample demonstrates superior performance compared to pure BWO, CN, KCN, and the heterojunction with pure CN (i.e., 2-BWO@CN) in terms of degrading TC and generating photocurrent under visible light. The study found that the degradation efficiency was affected by the dosage of 2-BWO@KCN and the presence of coexisting ions. Under optimal conditions, the degradation efficiency could reach 87% within 20 min of illumination. Additionally, through comprehensive experimental analysis, the degradation pathway, band structure, and mechanism were thoroughly explored. The superior photocatalytic performance of 2-BWO@KCN was attributed to its Z-scheme heterojunction structure, which significantly reduced the recombination of photogenerated electron and hole (e- /h + ) pairs. The radicals (center dot OH/center dot O2- 2- ) produced were identified using ESR, and their role in tetracycline degradation was further analyzed through active species trapping experiments.