Green Grids: Navigating the Transition to Renewable Energy Microgrids