Magnetic nanomaterials (MNPs) have been widely used in the detection of pollutants in the environment because of their excellent nano effect and magnetic properties. These intrinsic properties of MNPs have diversified their application in environmental contaminant detection. In this paper, the research status quo of the use of MNPs in detecting organic and inorganic contaminants from wastewater and soil is reviewed. The preparation method and modification technology of magnetic nanoparticles are also described in detail. The application prospect of magnetic nanoparticle composites in the detection of contaminants in water and soil is discussed. Compared with traditional detection methods, MNPs are more accurate and efficient in pollutant enrichment. Moreover, the biological synthesis of MNPs was proven to be eco-friendly and aided in sustainable development. The study shows that MNPs have good application prospects in soil pollution detection, but the mechanism still needs to be investigated to realize their popularization and application.