The electric power system is undergoing significant changes in power generation and distribution, with an increase in prosumers contributing to the growth of distributed generation. Microgrids have emerged as a focus of global research, representing a set of mini and micro-generators, energy storage systems, and loads that can operate connected to or isolated from the main power grid. MGs enhance flexibility and security in power systems, reducing losses and improving energy supply in specific areas. Machine learning (ML) techniques, such as the Random Forest Regressor (RFR), have been increasingly utilized for data prediction in various domains, including energy markets. This research employed RFR to forecast demand, energy tariffs, wind, and solar generation in a microgrid. Data from Ontario, Canada, was collected for this purpose. The results demonstrated satisfactory performance for demand and solar generation predictions, exhibiting high accuracy with low Mean Absolute Percentage Error (MAPE). However, tariff and wind generation predictions require further investigation to improve accuracy. The ML predictions will be utilized for energy management optimization and simulation in future works. Simulations in optimizing microgrid operations, with ML techniques contribute to more effective analysis and planning in the electrical sector. The study highlights the significance of research in this area to ensure reliable and efficient operation in the evolving power system.