In the contemporary landscape, the reuse of wastewater holds paramount significance. Concurrently, wastewater carries an array of pollutants encompassing chemical dyes and heavy metals. This study delves into the potential of Tamarix aphylla (TA) and Eucalyptus camaldulensis (EC) species for mitigating heavy metals in soil and eliminating methylene blue dye (MB) from wastewater. The research begins with assessing the dye adsorption process, considering pivotal factors such as initial pH, adsorbent dosage, initial dye concentration, and contact time. Outcomes reveal EC's superiority in dye removal compared to TA. As a bioremediation agent, EC exhibits a 90.46% removal efficacy for MB within 15 min, with pH 7.0 as the operative condition. Equilibrium analysis employs Temkin (T), Freundlich (F), and Langmuir (L) isotherms, revealing an excellent fit with the L isotherm model. The study delves further by probing surface adsorption kinetics through pseudo-first-order (PFO) and pseudo-second-order (PSO) models. Furthermore, to discern the divergent impacts of EC and TA on soil heavy metal reduction, soil samples were collected from three distinct zones: an untouched control area, alongside areas where EC and TA were cultivated at the Yazd wastewater site in Iran. Heavy metal levels in the soil were meticulously assessed through rigorous measurement and statistical scrutiny. The findings spotlight TA-cultivated soil as having the highest levels across all examined factors. Ultimately, EC emerges as the superior contender, proficiently excelling in both MB eliminations from wastewater and heavy metal amelioration in the soil, positioning it as the preferred phytoremediation agent.