The oral cavity comprises an environment full of microorganisms. Dysregulation of this microbial‐cellular microenvironment will lead to a series of oral diseases, such as implant‐associated infection caused by Staphylococcus aureus (S. aureus) biofilms and periodontitis initiated by Streptococcus oralis (S. oralis). In this study, a liposome‐encapsulated indocyanine green (ICG) and rapamycin drug‐delivery nanoparticle (ICG‐rapamycin) is designed to treat and prevent two typical biofilm‐induced oral diseases by regulating the microbial‐cellular microenvironment. ICG‐rapamycin elevates the reactive oxygen species (ROS) and temperature levels to facilitate photodynamic and photothermal mechanisms under near‐infrared (NIR) laser irradiation for anti‐bacteria. In addition, it prevents biofilm formation by promoting bacterial motility with increasing the ATP levels. The nanoparticles modulate the microbial‐cellular interaction to reduce cellular inflammation and enhance bacterial clearance, which includes promoting the M2 polarization of macrophages, upregulating the anti‐inflammatory factor TGF‐β, and enhancing the bacterial phagocytosis of macrophages. Based on these findings, ICG‐rapamycin is applied to implant‐infected and periodontitis animal models to confirm the effects in vivo. This study demonstrates that ICG‐rapamycin can treat and prevent biofilm‐induced oral diseases by regulating the microbial‐cellular microenvironment, thus providing a promising strategy for future clinical applications.