The reduced coenzymes (NADH and NADPH) are an important product in energy metabolism and closely related to the occurrence and development of cancer. So it is necessary to use a powerful detection tool to visualize NAD(P)H in energy metabolism of tumor cells and find a new strategy to improve cancer treatment based on NAD(P)H. Herein, a novel multifunctional probe (Cy-N) is synthesized with good near-infrared fluorescence (NIRF) response to NAD(P)H and the photoacoustic (PA) and photothermal properties are successfully activated by NAD(P)H. The probe is successfully applied in visualizing NAD(P)H in energy metabolism of tumor cells and imaging NAD(P)H in bacteria. Moreover, the probe can be used to image NAD(P)H in energy metabolism of tumor-bearing mice by dual-modal imaging (NIRF and PA). More importantly, in terms of the role of NAD(P)H in energy metabolism, the photothermal therapy (PTT) is activated by NAD(P)H and a novel strategy of enhanced PTT is proposed by injecting glucose. As far as we know, this is the first probe to detect NAD(P)H in energy metabolism through dual-modal imaging, and also the first probe to activate PTT based on NAD(P)H, which will provide important information of the diagnosis and treatment of cancer.