The increasing global emphasis on sustainability has accelerated investments in renewable energy technologies, positioning sources like solar, wind, and hydroelectric power as vital alternatives to fossil fuels. Despite significant progress, integrating renewable energy into existing grids remains challenging due to variability in energy output, grid instability, and inefficiencies in energy storage systems. This study investigates the potential of machine learning (ML) to revolutionize the renewable energy sector by enhancing energy forecasting, grid management, and energy storage optimization. Using a combination of supervised learning, deep learning, and reinforcement learning techniques, we developed predictive and optimization models based on historical and real-time datasets. Additionally, structural equation modeling (SEM) with SmartPLS was employed to analyze the relationships between key variables, such as machine learning algorithms, renewable energy sources, sustainability performance, and operational efficiency. The results indicate that machine learning significantly improves energy forecasting accuracy, grid reliability, and storage efficiency, with R-squared values of 0.685 for operational efficiency and 0.588 for sustainability performance. These findings highlight the transformative role of ML in optimizing renewable energy systems and achieving sustainable energy goals. While ML offers promising solutions for renewable energy challenges, further research is needed to address real-time data integration, model scalability, and economic feasibility. This study provides a foundation for future innovations, emphasizing the importance of intelligent, data-driven strategies in advancing global energy sustainability.