Textiles that protect against bacterial nosocomial infections are vital owing to the associated high morbidity, mortality, and a series of challenges that remain in the treatment of drug-resistant bacteria. To overcome these hurdles, a universal coating was developed by combining g-C 3 N 4 /ZIF-8 heterojunction nanoparticles and hydrophobic waterborne polyurethane (PU) to form protective textiles with remarkable antibacterial, anti-adhesive, and antifouling performance. The g-C 3 N 4 /ZIF-8 nanoparticles produce reactive oxygen species to render Escherichia coli and Staphylococcus aureus inactive upon visible light illumination, while hydrophobic waterborne PU hinders bacterial adhesion on coated textiles. The synergy of photocatalytic nanoparticles and hydrophobic polymers is what endows textiles with these remarkable antibacterial properties. Moreover, coated textiles also demonstrate antifouling ability, such as the degradation of methylene blue dyes under visible light illumination. As a proof of concept, this coating was applied to common masks, which were then found to exhibit prominent antibacterial properties. The coating design proposed in this study provides a scalable strategy for the preparation of commercial antibacterial textiles.