This research develops a co-design optimization framework for microgrids that simultaneously designs physical infrastructure and control systems. By improving both reliability and cost-effectiveness, it enables more resilient renewable energy networks, supports upgrades to existing microgrids, and helps communities maintain electricity during extreme weather events and grid failures.