In the field of environmental science, efficient removal of organic pollutants and pathogenic bacteria from wastewater using a photocatalytic process that responds to the full spectrum of sunlight is crucial. In this study, a highly effective nanoheterojunction called NaGdF4:Yb,Er@zeolitic imidazolate framework‐8/manganese dioxide (NaGdF4:Yb,Er@ZIF‐8/MnO2, UCZM) was synthesized. This nanoheterojunction exhibits a remarkable ability to respond to the entire range of ultraviolet, visible, and infrared light. Under simulated sunlight, UCZM demonstrated outstanding performance in degrading malachite green dye, with a degradation efficiency of 92.6% within 90 min. Moreover, UCZM completely inactivated both Staphylococcus aureus and Escherichia coli within 20 min under simulated sunlight. Mechanistic studies revealed that NaGdF4:Yb,Er played a crucial role in activating ZIF‐8 and MnO2 through Förster resonance energy transfer, facilitating the photocatalytic process. The formation of a Z‐type heterojunction in UCZM promoted the efficient separation of photogenerated carriers. Furthermore, UCZM exhibited excellent biosafety properties. This study represents the first exploration of a composite material composed of UCNPs, ZIF‐8, and MnO2 for photocatalytic applications. The findings highlight the potential of this novel nanoheterojunction design, which exhibits a full spectral response, for tackling water pollution through efficient photocatalytic degradation of organic pollutants and inactivation of pathogenic bacteria.image