The rapid growth of global industry and population has caused severe freshwater shortages, necessitating advanced water treatment and harvesting technologies. Hydrogels, with their three-dimensional network structures and exceptional water absorption properties, are emerging as effective materials for water purification. This study focused on synthesizing a novel copolymer from N-(2-vinyloxyethyl)-N-(2-cyanoethyl)amine (VOECEA) and maleic anhydride (MAh) through radical copolymerization, utilizing azobisisobutyronitrile (AIBN) as an initiator in a 30% cyclohexane and 70% ethyl acetate solvent mixture at 70 °C. The copolymers were characterized using Fourier-transform infrared (FT-IR) spectroscopy, thermogravimetric analysis (TGA), elemental analysis, and nuclear magnetic resonance (NMR) spectroscopy. Post-synthesis, the nitrile groups were modified using a methanol-water solution containing NH2OH∙HCl and NaOH at 80 °C. The modified hydrogels demonstrated effective removal of heavy metal ions, including lead (Pb²⁺) and cadmium (Cd2+), and organic pollutants such as dyes, show casing their potential for addressing critical water contamination challenges.