The unreasonable use of organic dye leads to excessive residues in environmental water, which seriously threatens human health and the natural environment. In this paper, a spherical flower-like magnetic Fe3O4@CoNi layered double hydroxide@silver nanoparticle (Fe3O4@CoNi LDH@Ag NPs) SERS substrate was successfully fabricated via electrostatic self-assembly and applied for the sensitive detection of methylene blue (MB) in environmental water. The rapid concentration and separation of the SERS substrate from the water sample could be achieved using an external magnet. The Fe3O4@CoNi LDH@Ag NPs could not only rapidly enrich the trace analytes because of their outstanding absorptive capacity but also effectively enrich the cationic dye molecules to the "hot spots" through electrostatic interactions, resulting in higher SERS selectivity. Excellent SERS performance was observed, which exhibited a high enhancement factor (EF) of 5.81 × 108 and a low detection limit (LOD) of 1 × 10-11 mol L-1 with R6G as the probe molecule, and also possessed exceptional reproducibility and stability for at least 28 days. The Fe3O4@CoNi LDH@Ag NPs were used to detect MB, which displayed wide linearity (1 × 10-10 to 1 × 10-4 mol L-1) and high recoveries (89.68-103.72%). This Fe3O4@CoNi LDH@Ag NP substrate offers easy separation and selective detection of cationic dyes, providing potential application for the detection of environmental contaminants.