Accurate forecasting of the El Niño Southern Oscillation (ENSO) plays a critical role in mitigating the impacts of extreme weather conditions linked to ENSO variability on ecosystems. This study evaluates the performance of six machine learning models in forecasting two ENSO types: the Central Pacific El Niño (Niño 4 index) and the East Central Pacific El Niño (Niño 3.4 index). The models analyzed include the Feed Forward Neural Network (FFNN), Long Short-term Memory (LSTM) neural network, eXtreme Gradient Boosting Regressor, K-Nearest Neighbors Regressor, Gradient Boosting Regressor, and Support Vector Regressor, using the ENSO index lagged by six months as the predictor. The models were trained on the monthly ENSO indices from 1870 to 1992 and tested from 1993 to 2023. We also assess the relative predictability of the two ENSO types. Events were defined as when the ENSO index exceeded ±0.4. Our evaluation during the testing period reveals that for the analyzed models, the deep neural network models (LSTM and FFNN) demonstrated superior performance in forecasting ENSO at a 6-month lead time. Furthermore, all models achieved impressive all-season correlations ranging from 0.93 to 0.97 and threat score for the ENSO phases between 0.71 to 0.88 for Niño 3.4 events, and 0.72 to 0.93 for Niño 4 events. The predictability of the two ENSO types depended on the model and strength of the ENSO event. Considering both ENSO phases, La Niña events were forecasted with a higher accuracy relative to El Niño events, and all models, besides the deep learning models, notably fell short in capturing the extreme 2015/2016 Central Pacific El Niño event. These results highlight the potential of machine learning models, particularly the deep learning approaches, for skillful ENSO forecasting, by leveraging its historical data.