At present, the global freshwater resources are severely lacking, and all life activities rely on freshwater resources. Industrial and domestic wastewater contain a large amount of toxic heavy metal ions and other toxic substances, which are not only harmful to human health but also cause significant damage to the environment. Therefore, it is necessary to detect and remove these metal ions. Although many technologies have been studied, there are still many deficiencies. At the same time, due to the vast proportion of the ocean on the earth, people hope that seawater resources can also be utilized by humans, and research on seawater desalination technology is being carried out. Capacitive deionization (CDI) technology has high desalination efficiency and no secondary pollution during the desalination process, and is therefore widely used. The core of these technologies lies in the materials used. Graphene-like materials, with their large specific surface area and numerous surface active sites, have been widely studied, especially transition metal dichalcogenides (TMDs) materials, which have excellent physical and chemical properties. This article mainly introduces the application of TMDs materials in the detection and removal of heavy metal ions in solutions and in CDI desalination, analyzes the advantages and disadvantages of the materials, and discusses the future development direction.