The development of advanced photocatalysts with enhanced efficiency for environmental remediation is critical for addressing persistent organic pollutants like Moxifloxacin. In this study, we present a novel S-scheme heterojunction g-C3N4/TiO2/M photocatalyst designed to optimize light harvesting and charge separation for the effective degradation of Moxifloxacin. The innovative S-scheme configuration enables superior charge transfer dynamics by retaining potent photogenerated electrons in the conduction band of TiO2 and holes in the valence band of g-C3N4, significantly improving photocatalytic performance compared to conventional Type-II systems. Heterogeneous photocatalysis, particularly using TiO2-based materials, offers a promising approach. Here, we synthesized TiO2 hybridized with metal-doped g-C3N4 (GCNTM) via a simple hydrothermal method. The fabricated nanocomposites were characterized using SEM, XRD, FTIR, and UV–Vis (DRS). These GCNTM nanocomposites were employed for the degradation of hazardous Moxifloxacin (MXF) under visible light. Detailed analysis of the photocatalytic mechanism reveals that the synergistic interaction between g-C3N4, TiO2, and the co-catalyst M not only broadens the light absorption spectrum but also enhances the separation and lifespan of charge carriers. Among the synthesized materials, GCNTLa demonstrated the highest degradation efficiency, achieving 96 % removal of MXF. This enhanced activity is attributed to the effective suppression of charge recombination, leading to the generation of reactive species responsible for MXF degradation. Additionally, GCNTM showed remarkable stability and reusability, with only a 6 % reduction in efficiency after five cycles, confirming its high reusability and mechanical stability. Our S-scheme photocatalyst demonstrates a marked increase in the degradation rate of Moxifloxacin under visible light irradiation, highlighting its potential for practical environmental applications.