Carbon dioxide (CO2) sequestration in underground formations is one of the effective processes of decreasing carbon emissions. CO2 injection in coalbeds improves methane production from coal formations (ECBM) with storing CO2 for environmental purposes. The performance ECBM process and CO2 injection depend on the wettability behavior in the coal/water/CO2 system. The wettability can be measured using different experiments; however, these measurements are time-consuming, expensive, and highly inconsistent. Therefore, this paper aims to apply Linear regression (LR), XGBoost Model, and random forests (RF) as machine learning (ML) tools to predict the contact angle in the coal–water–CO2 system. A dataset of 250 points was collected for different coal samples at different conditions. The ML methods were used to predict coal-water–CO2 contact angle (CA) as a function of coal properties, system pressure, and temperature. The results from LR, XGBOOST, and RF models showed their competency to predict the contact angle in the coal/water/CO2 system as a function of coal properties and the system conditions. The R values between actual and model CA from the LR model were found to be 0.86 and 0.87 compared to 0.99, and 0.97 from the RF model. The XGBOOST model shows an R-value of 0.99 and 0.96 in the different datasets. AAPE was less than 13% in the three ML models. This study provides ML applications to accurately forecast the contact angle in the coal–water–CO2 system based on the coal properties, pressure and temperature, and water salinity without the need for experimental measurements of complicated calculations.