## 1 Introduction  
Microgrids (MGs) are small-scale, localized electrical grids that can work separately or in coordination with the main power grid. Hybrid microgrids are designed to provide reliable and efficient power to a designated zone or community, such as a university campus, military facility, or isolated village. These systems usually comprise an array of distributed energy sources like photovoltaic, wind turbines, battery storage systems, and auxiliary generators [1]. Moreover, they usually integrate advanced control mechanisms and energy management software tools to increase energy usage and minimize costs. This article presents the optimal planning and operation of a hydrogen-based microgrid incorporating renewable energy resources (RESs), including wind turbines, solar systems, and fuel cells and electrolyzers. Effectively managing these resources, principally fuel cells and electrolyzers, in line with their operational specifications presents an optimized design and energy management strategy. This approach anticipates the behavior of fuel cells and electrolyzers, ensuring compliance with each unit's effective constraints [2]. In this research, hydrogen is generated using distinct methods to fulfill the requirements for fuel cells (FCs). The MG's system design is heightened by reducing annual costs, decreasing fuel consumption, and increasing the deployment of RESs. The power produced by RESs is either employed to satisfy the MG's demand or transformed into hydrogen through electrolysis processes. Any surplus power is then directed to the grid. To ensure a balance between production and demand, it's essential to assess both the technical and economic constraints of HMGs. As the energy sector evolves towards a more sustainable and distributed system, microgrids are becoming an accessible solution for integrating RESs, escalating energy efficiency and resiliency, and reducing carbon emissions [3]. However, effective management and control of MGs remains a significant challenge that requires the development of advanced strategies and technologies [4]. Numerous energy management and control strategies exist for microgrids, encompassing centralized and decentralized approaches [5]. Centralized approaches typically involve innovative control. Microgrid EMS plays a vital role in addressing the challenges of distributing and integrating distributed energy resources (DERs) into the electric grid [6]. The efficient use of RESs has become a significant priority in MGs energy management, which can help to enhance energy resilience by reducing carbon emissions, improving power quality and reliability [7]. Several energy management and control approaches that have been utilized to optimize the performance of microgrids include optimal power flow (OPF), demand response (DR), and energy storage systems (ESS). OPF optimally coordinates the production and consumption of electricity from DERs to reduce energy wastage and costs [8], whereas DR strategies help to match the demand for electricity with the available supply by providing incentives for consumers to decrease their demand during phases of high energy demand [9]. In this context, energy storage systems become essential to manage the imbalance between energy supply and demand [10]. Centralized approaches involve a central controller that manages the operation of the micro-grid system. \"Here central control CC system controls\" is considered by a high-performance figuring unit and a protected communication organization to accomplish various objects of the scheme (e.g., RESs and ESS). Meanwhile, LC is the local control system of the system (Figure 1). Decentralized approaches, on the other hand, distribute control among various components of the system. All the entities are controlled at different levels, and there is no need for a high-performance computing unit in this approach (Figure 2), while hybrid approaches combine the features of both centralized and decentralized approaches.