Substantial improvement is needed in efficient and affordable decolorization and disinfection methods to solve the issues caused by dyes and harmful bacteria in water and wastewater. This work involves the photocatalytic degradation of methylene blue (MB) as well as gram-negative and gram-positive bacteria by cobalt-doped tin oxide (Co-SnO2) nanoparticles (NPs) and Co-SnO2/SGCN (sulfur-doped graphitic carbon nitride) nanocomposites (NCs) under sunlight. The coprecipitation approach was used to synthesize the photocatalysts. Maximum methylene blue (MB) photocatalytic degradation was seen with the 7% Co-SnO2 NPs compared to other (1, 3, 5, and 9 wt.%) Co-SnO2 NPs. The 7% Co-SnO2 NPs were then homogenized with different amounts (10, 30, 50, and 70 weight %) of sulfur-doped graphitic carbon nitride (SGCN) to develop Co-SnO2/SGCN heterostructures with the most significant degree of MB degradation. The synthesized samples were identified by modern characterization methods such as FT-IR, SEM, EDX, UV-visible, and XRD spectroscopies. The Co-SnO2/50% SGCN composites showed a significant increase in MB degradation and degraded 96% of MB after 150 min of sunlight irradiation. Both gram-negative (E. coli) and gram-positive (B. subtiles) bacterial strains were subjected to antibacterial activity. All samples were shown to have vigorous antibacterial activity against gram-positive and gram-negative bacteria, but the Co-SnO2/50% SGCNcomposites exhibited the maximum bactericidal action. Thus, the proposed NC is an efficient organic/inorganic photocatalyst that is recyclable and stable without lowering efficiency. Hence, Co-SnO2/50% SGCNNC has the potential to be employed in water treatment as a dual-functional material that simultaneously removes organic pollutants and eradicates bacteria.