This work created, characterized, and used a magnetic biochar catalyst that is both eco-friendly and very effective. Sugarcane bagasse was selected as primary raw material for catalyst preparation, because it is renewable and ecofriendly biomass. Catalyst created by doping sugarcane bagasse biochar with magnetic material in the form of (FeSO4·7H2O). Thermogravimetric Analysis (TGA) and Fourier Transform Infrared spectroscopy (FTIR) were used to characterize the catalyst. In addition, physical and textural characteristics of the catalyst were identified and interpreted. The characterization outcome showed that the catalyst has good catalytic qualities. For the manufacturing of biodiesel, discarded cooking oil served as the primary feedstock. The experiment was created utilizing the Box–Behnken Design (BBD) technique. There are four variables with the following three levels each: temperature, methanol to oil ratio, catalyst concentration, and reaction time. 29 experiments in total were carried out. Using the RSM function, optimization was done. The optimal conditions for obtaining biodiesel yield—temperature, methanol to oil ratio, reaction time, and catalyst weight—were 43.597 °C, 9.975 mol/L, 49.945 min, and 1.758 wt%. A study of the produced biodiesel using a FTIR showed that the conventional biodiesel IR spectra were confirmed. All physiochemical characteristics found suggested the biodiesel complied with ASTM and EN norms. Overall, the synthesized catalyst had conducted simultaneous reactions in a single batch reactor and had demonstrated suitability for converting used cooking oil to biodiesel.