Algerian kaolinite, sourced from Djebel Debbagh nuance 3 (DD3), was used as a low-cost adsorbent to remove methylene blue (MB) dye from water. Its adsorption capacity was enhanced through sulfuric acid treatment (treated-DD3). In response to the urgent demand for clean water, various technologies have been developed to address dye removal from wastewater. This study, specifically delving into the treatment of textile wastewater, examined the efficacy of treated-DD3 through adsorption processes. The acid treatment increased the surface area and pore volume of DD3. X-ray diffraction showed crystalline phases in both, with treated-DD3 having higher crystallinity. Fourier-transform infrared spectroscopy found no significant differences post-acid treatment. Scanning electron microscopy revealed DD3 had large, stacked particles with low surface area, while treated-DD3 had increased porosity and a smoother surface. Various parameters affecting MB adsorption were studied. The Langmuir and Freundlich models were used for isotherm parameters. Treated-DD3 exhibited a higher MB adsorption capacity (64.58 mg/g according to the Langmuir model) than DD3 (44.48 mg/g). Thermodynamic analysis indicated spontaneous and endothermic MB adsorption onto both DD3-BM and treated-DD3-BM systems under different pH conditions. Treated-DD3 effectively reduced chemical oxygen demand (from 304.056 mg/L to 34.44 mg/L) and biological oxygen demand (from 80 mg/L to 20 mg/L) in real textile wastewater. The adsorbent exhibited rapid removal and decolorization, surpassing 93% within the first 7 min of the experiment. The Gaussian process regression and particle swarm optimization (GPR–PSO) predicted MB adsorption capacity effectively (R = 0.9989, R2 = 0.9978, adj-R2 = 0.9978, RMSE = 1.1390, and MAE = 0.3926).