The ultimate goal of phototherapy based on nanoparticles, such as photothermal therapy (PTT) which generates heat and photodynamic therapy (PDT) which not only generates reactive oxygen species (ROS) but also induces a variety of anti-tumor immunity, is to kill tumors. In addition, due to strong efficacy in clinical treatment with minimal invasion and negligible side effects, it has received extensive attention and research in recent years. In this paper, the generations of nanomaterials in PTT and PDT are described separately. In clinical application, according to the different combination pathway of nanoparticles, it can be used to treat different diseases such as tumors, melanoma, rheumatoid and so on. In this paper, the mechanism of pathological treatment is described in detail in terms of inducing apoptosis of cancer cells by ROS produced by PDT, immunogenic cell death to provoke the maturation of dendritic cells, which in turn activate production of CD4+ T cells, CD8+T cells and memory T cells, as well as inhibiting heat shock protein (HSPs), STAT3 signal pathway and so on.