Microgrids, as localized energy systems comprising distributed power generation sources, offer resilience, flexibility, and efficiency to the modern power grid. Integrating various distributed energy resources (DERs) within microgrids poses challenges in optimizing their operation to ensure reliable and cost-effective energy supply. This paper presents a comprehensive review and analysis of optimal operating methods for the integration of distributed power generation within microgrids.The study explores various aspects of microgrid operation, including optimal dispatch strategies, demand-side management techniques, energy storage utilization, and renewable energy source integration. It investigates the application of advanced optimization algorithms, such as linear programming, mixed-integer linear programming, and metaheuristic algorithms, to address the complex optimization problems inherent in microgrid operation. Furthermore, the paper examines the role of smart grid technologies, advanced control systems, and communication infrastructure in facilitating the efficient operation of microgrids with distributed power generation. It discusses the importance of real-time monitoring, data analytics, and predictive modeling for enhancing decision-making processes and optimizing microgrid performance.