A near- and mid-infrared plasmon resonance nanomaterial, a preparation method and its application in antibacterial and antifungal aspects belong to the technical field of nanomaterials and applications. It specifically relates to aluminum-doped zinc oxide, tin-doped indium oxide, gallium-doped zinc oxide, indium-doped cadmium oxide, indium-doped zinc oxide, antimony-doped tin oxide, fluorine-doped tin oxide, gallium oxide and other nanoparticles. The invention utilizes the quantum effect, small size effect and special structure of nanomaterials to form near- and mid-infrared plasmon resonance phenomena on the surface of nanoparticles, and utilizes the conversion of plasmon resonance energy of near- and mid-infrared light energy to effectively eliminate organic microorganisms. Under the irradiation of sunlight (or ambient light), the surface of these materials produces plasmon resonance absorption, and the energy generated interacts with the protein on the surface of the bacteria to kill the bacteria. At the same time, this type of nanomaterial has a large specific surface area, which makes it easier to have a large area of contact with the surface of bacteria, and is also conducive to the digestion of bacteria.