In this paper, an optimization solution is introduced to address an Energy Management problem for a Microgrid comprising Photovoltaic arrays, Wind Turbines, Combined Heat and Power units, and a Battery Energy Storage System. The goal is to establish an optimal Energy Management System that minimizes operational costs by efficiently dispatching the required load demand among the available electricity resources. Traditionally, Diesel generators have served as the main source of load supply in microgrids. However, the integration of renewable energy sources and storage systems into microgrids has led to a decrease in electricity generation costs and an enhanced ability to reduce harmful emissions from conventional resources. Given the intermittent nature of renewable resources, the existence of diverse distributed generators with varying operational costs, and the fluctuating electricity consumption patterns, there is a continuous demand for a robust Energy Management System. Such a system enables grid operators to maintain a cost-effective, efficient, and reliable balance between supply and demand. Consequently, optimization algorithms have become indispensable for developing the most efficient Energy Management System. This study utilizes the Political Optimizer and Pelican Optimization Algorithm to tackle the Energy Management problem in the microgrid. The primary objectives of these innovative optimization algorithms are to minimize operational costs, ensure supply-load balance, and increase the penetration of renewable resources for electricity generation in the microgrid. Through extensive numerical results and statistical analyses, the effectiveness and superiority of the proposed optimization algorithms are demonstrated. The outcomes illustrate cost reductions of up to 25% compared to conventional algorithms. Thus, it is evident from the results and statistical analyses that the Political Optimizer and Pelican Optimization Algorithms exhibit the capability to efficiently address various optimization challenges and deliver optimal results in the initial iterations.