In this study, a type of blue‐emission fluorescent carbon dot was synthesized using malic acid, urea, and water. This material demonstrates strong stability to heat, ionic strength, and time. It was found that mercury ions can quench the blue fluorescence of the material, and using iodine ions, the fluorescence can be recovered. Hence, we designed an “off–on” mode to detect mercury and iodine ions using the carbon dots. The results showed that this material exhibits good selectivity and recovery rate. Concurrently, imaging experiments showed that this material demonstrates low cytotoxicity and can be used in cell fluorescence imaging. The study concludes that this material has wider application prospects in the future.