Our study explores the potential of utilizing peanut shells, an abundant and low-cost food waste, as a natural adsorbent for the removal of industrial dyes, specifically methylene blue. We conducted a detailed investigation of the adsorption process, which revealed that it conforms to both Langmuir and Freundlich isotherms, indicating the ability of peanut shells to adsorb methylene blue effectively. To optimize the adsorption yield, we employed a Box-Behnken experimental design. This approach allowed us to assess the impact of several key factors, including the mass of the adsorbent, dye concentration, pH, temperature, stirring rate, and the ionic strength of salts in the solution. The mathematical model and simulation of the adsorption process helped us identify the best conditions for maximizing the dye removal. Our experiments resulted in a maximum adsorption efficiency of 97%, achieved under optimal conditions: 1.5 g of adsorbent, a methylene blue concentration of 40 mg/L, pH 11, temperature of 65°C, 0 mg/L ionic strength, and a stirring rate of 165 rpm. These findings suggest that peanut shells are a viable, eco-friendly alternative for dye removal, offering a sustainable solution for wastewater treatment and contributing to waste reduction.