Environmental limitations of conventional homogeneous catalysts, including difficult separation and wastewater generation, have intensified the search for sustainable heterogeneous alternatives derived from waste resources. This study developed a novel heterogeneous catalyst by immobilizing CaO-MgO-rich petrochemical sludge onto hydrochar synthesized from almond shells via hydrothermal carbonization. The catalyst was characterized using X-ray fluorescence (XRF), X-ray diffraction (XRD), Fourier-transform infrared spectroscopy (FTIR), Hammett titration, and scanning electron microscopy (SEM), indicating the successful incorporation of metal oxides and the presence of active basic sites on the support. The structural features of the hydrochar may enhance reactant accessibility.Catalytic performance was evaluated in waste cooking oil transesterification, investigating catalyst concentration (3-9 wt.%), oil-to-methanol volume ratio (0.8-2.4 v/v), reaction time (60-150 min), and n-hexane co-solvent concentration (0-20 wt.%) at 63 °C. Response surface methodology (RSM) via Box-Behnken design was applied to optimize fatty acid methyl ester percent (FAME%). Statistical analysis showed that reaction time was the most influential parameter, while catalyst concentration and co-solvent concentration also had significant effects, and the developed model exhibited high predictive capability (R2=0.9827, R2=0.9624, and R2=0.9037). Under optimal experimental conditions (5.5 wt.% catalyst, 1.8 v/v ratio, 136 min, and 15.6 wt.% n-hexane), a biodiesel FAME of 98.77% was predicted. Additionally, the catalyst was tested for reusability over six cycles, demonstrating consistent performance with biodiesel FAME ranging from 98.49% to 94.32%, with spent catalyst characterization evaluating stability. These findings underscore the efficiency and practical potential of this waste-derived system, demonstrating a circular-economy approach by integrating industrial and agricultural wastes into heterogeneous catalysts for biodiesel production.