Activated carbon (AC) prepared from the Tamarisk of Iran was used as a novel, local, and nontoxic adsorbent for the removal of methylene blue (MB) and lead(II) ion from aqueous solutions. This new material was prepared in our laboratory using the routine procedure and its surface properties including surface area, pore volume, and functional groups were characterized with various techniques such as BET, FTIR, and scanning electron microscopic analyses. The influence of initial concentration of MB and Pb2+ ion, pH, contact time, and adsorbent mass on the adsorption efficiency was investigated and optimized. The evaluation and estimation of equilibrium data from among traditional isotherm models display that the Langmuir model indicated the best fit to the equilibrium data with a maximum adsorption capacity of 27.5 mg g−1, while the adsorption rate efficiently follows the pseudo-second-order model. Two models, namely multiple linear regression and random forest (RF), were used for modeling and optimization of the whole procedure. Results obtained show that the RF model was a powerful tool for the prediction of MB and Pb2+ ion adsorption by AC obtained from Tamarisk. The optimal tuning parameters for the RF model were obtained based on ntree = 100 and mtry = 2. In the training data-set for MB and Pb2+ ion, the mean squared error values of 0.0003 and 0.0002, and the coefficient of determination (R2) values of 0.9952 and 0.9963 were obtained using the RF model, respectively.