Hybrid energy systems (HESs) are one of the most effective solutions for the power demand especially in remote areas. It is well-known that the HESs usually include renewables like solar and/or wind energy sources. Renewables are intermittent, fluctuating, and nonlinear. Therefore, an effective energy management plays an essential role in organizing the power flow in hybrid energy sources. In this work, a hybrid energy system (HES) composed of wind, gasoline and diesel generator is used as a case study to electrify a specific remote area. The sources of the HES are categorized in different arrangements to select the best combination from all available six energy sources combinations based on five criteria using the technique for order of preference by similarity to ideal solution (TOPSIS). This work is divided into two stages, in the first stage; a historical demand side dataset is used to model and calculate the five criteria. TOPSIS method results are combined with the five criteria and the demand side to form a dataset. In the second stage, machine learning algorithms, namely random forest (RF) and light gradient boosted machine (LightGBM) algorithms are used to predict the combination of the energy sources as a way of validating the proposed work. Evaluating the algorithms shows the superiority of RF algorithm with accuracy of 81.81% over LightGBM with accuracy of 68.6%. The behavior of both algorithms is explained using the confusion matrix. RF algorithm classifies the classes G1G2, and G2 correctly and misclassifies some values of the other classes. On the other hand, LightGBM algorithm classifies the class G2 correctly and misclassifies some values of the other classes.