The negative impact of excessive exposure to agrochemicals in shallot cultivation causes environmental pollution and human health. Biochar has the potential to absorb agrochemical contamination. This research aimed to investigate the effect of providing compost and biochar from agricultural waste on land quality, reducing the concentration of heavy metal cadmium (Cd) and mancozeb pesticide residues in soil and products in shallot. The experiment was carried out in shallot fields in Ngurensiti Village, Pati Regency, Central Java Province. Four different treatments, including combinations of biochar and compost, were applied, along with conventional controls. Data were analyzed using the F test (ANOVA) and Tukey's test using the Minitab statistical program version 16.0. The research showed that using biochar made from sugarcane bagasse, rice husk, corncob, and compost helped more soil bacteria grow and lowered Cd and mancozeb concentrations. In addition, treatment with biochar from sugarcane bagasse waste showed a decrease in Cd and mancozeb concentrations and a more significant increase in bacterial populations compared to other treatments (rice husk biochar and corncob biochar). Although there was a slight increase in Cd concentration in shallot leaves post-treatment, Cd levels in shallot bulbs remained within safe limits. This study shows that using biochar and compost from agricultural waste effectively improves soil quality, reduces heavy metal pollution, and lowers pesticide levels to support sustainable agriculture and protect people's health.