A lightning search algorithm (LSA) has been used in this paper to determine the optimal design and energy management of hybrid systems (HS), including wind turbines (WT), photovoltaic panels (PV), electrolizers (EL), fuel cells based on hydrogen storage, and batteries for short-and long-term energy storage in the Arabian Gulf region. Furthermore, the proposed algorithm has the potential to facilitate the development of cost-effective and efficient HS designs, which could significantly contribute to the development of renewable energy sources in the region. HS is evaluated using real-world radiation and wind speed data in order to minimize the hybrid system's net present cost (NPC) and fulfill its reliability requirements. In order to effectively utilize renewable energy sources in unpredictable and fluctuating weather conditions, hybrid renewable power systems must be optimally designed. Based on the simulation results of the LSA in MATLAB simulator over a period of five years, an objective function is calculated. This function includes the investment, operation and maintenance costs of HS. A power management strategy ensures optimal use of spare energy. The proposed planning identifies optimal decision variables with fast convergence, lower costs, and higher reliability. Moreover, it provides an effective solution for maintaining an appropriate balance between the conflicting objectives of cost, reliability, and sustainability.