The valorization of biogenic waste by hydrothermal carbonization is widely discussed in research. However, to our knowledge, no study has combined almond shells and olive pomace to synthesize a solid carbon material. The purpose of this study is to enhance the hydrochar process from AS and OP using RSM methodology and machine learning models: ANN, SVM and XG-Boost. Subsequently, a study was carried out on the removal of organic pollutants by the synthesized material. The optimum Co-HTC operating conditions obtained at 180 C, 90 min with acid catalyst corresponding to 71.51 % and 87.13 % for mass yield and carbon retention rate respectively according to RSM-CCD. The comparison between RSM-CCD and ML in terms of prediction concludes that RSM remains more efficient in terms of planning and optimization. However, ANN is more suitable for modeling and predicting mass yields and carbon retention rates. Hydrochar’s physicochemical properties were evaluated by the use of spectroscopic methods like FTIR, SEM, XRD, and CHNO. To conclude, we studied the performance of HCop in methylene blue adsorption, varying the following parameters: pH, contact time, initial dye concentration, adsorbent dose and temperature. In addition, kinetic and isothermal models were studied to describe the dominant mechanisms in the MB adsorption process. The MB maximal adsorption using HCop obtained at pH 9, with an initial dye concentration of 100 mg. L−1, 40-min contact time, 0.1 g/L adsorbent dose, and a temperature between 25 and 30 °C. In conclusion, these results provide important information on the use of Co-HTC to convert biogenic wastes into high-performance carbon materials for the appropriate removal of organic pollutants. More studies are needed to use the material in other fields of application.