Soil erosion, the degradation of the earth’s surface through the removal of soil particles, occurs in three phases: dislocation, transport, and deposition. Factors such as soil type, assembly, infiltration, and land cover influence the velocity of soil erosion. Soil erosion can result in soil loss in some areas and soil deposition in others. In this paper, we proposed the Random Search-Random Forest (RS-RF) model, which combines random search optimization with the Random Forest algorithm, for soil erosion prediction. This model helps to better understand and predict soil erosion dynamics, supporting informed decisions for soil conservation and land management practices. This study utilized a dataset comprising 236 instances with 11 features. The target feature’s class label indicates erosion (1) or non-erosion (−1). To assess the effectiveness of the classification techniques employed, six evaluation metrics, including accuracy, Matthews Correlation Coefficient (MCC), F1-score, precision, recall, and Area Under the Receiver Operating Characteristic Curve (AUC), were computed. The experimental findings illustrated that the RS-RF model achieved the best outcomes when compared with other machine learning techniques and previous studies using the same dataset with an accuracy rate of 97.4%.