Renewable energy resources are becoming more appealing as energy demand and fossil fuel costs increase. The hybridization of these resources has the potential to reduce unpredictability and intermittency while increasing efficiency. The accuracy of size optimization of hybrid renewable energy systems (HRES) can be improved by using accurate weather data that can be obtained through forecasting. Thus, to increase the precision of the size optimization, hourly forecasting of global horizontal irradiation, temperature, and wind speed for one year has been performed using Gaussian process regression (GPR), Support Vector Regression, Extreme Gradient Boosting, and Decision Tree techniques. The results of all four forecasting models (FM) are then compared and revealed that the results obtained from GPR are better than those of other FM; therefore, the forecasted data for solar, wind, and temperature obtained from GPR are used for sizing the HRES. The net present cost is utilized to analyze the viability of the HRES while considering system reliability. Furthermore, recently developed optimization algorithms, namely the Colony Predation Algorithm (CPA), Tunicate Swarm Algorithm (TSA), and Aquila Optimization (AO) algorithms have been applied to the sizing of a grid-connected HRES to meet the energy needs of a remote site in the Indian province of Haryana. A comparison of CPA, AO, and TSA has been carried out and revealed that TSA offers more promising outcomes. In addition, the simulation results demonstrate a 0.42% reduction in per unit cost of energy when forecasted data has been used for size optimization.