Zinc oxide (ZnO), a commonly used photocatalyst, suffers from the rapid recombination of photogenerated charge carriers, and the inability to harvest visible light. Therefore, the green synthesized ZnO from Garcinia mangostana pericarp is modified via non-metal (X) doping of N, P, S, Br, and B with a mass content of 5 % to tackle the aforementioned. The obtained materials were characterized through various modern characterization techniques. The results reveal that amongst the X-doped sample, ZnO-B demonstrates the highest photocatalytic performance. The characteristics of ZnO include good crystallinity as well as a low band gap energy of 2.094 eV, revealing an enhanced visible light absorption activity of the sample. The photoactivity of surveyed ZnO-B was investigated through the degradation of malachite green, methyl orange, and tetracycline, achieving a removal rate of 96.29, 86.59, and 90.32 %, respectively. Simultaneously, the antibacterial properties of the ZnO-X were evaluated for Staphylococcus aureus under sunlight illumination. Moreover, the photocatalysis mechanism of the studied materials was elucidated through the band structure, toxicity, and total organic carbon removal of the post-catalysis solution. The selected boron-doped zinc oxide catalyst also showed excellent reusability after 10 cycles of photocatalysis, retaining ∼ 80 % of its original activity. The obtained results reveal the potential application of non-metal-doped zinc oxide in environmental remediation and water disinfection.