The cost-effectiveness of the hybrid design of microgrids for determining if a hybrid MG system is necessary is taken into consideration as the study focuses on improving power access in an optimal and economical manner. Both the cost of electricity (COE) and the loss of power supply probability (LPSP) of the hybrid MG design are optimized. The hybrid microgrid design including the photovoltaic (PV)-wind systems with battery storage and diesel generators are modeled and optimized for technical and economic feasibility using MATLAB. The energy management technique is applied between hybrid energy sources and loads. For this hybrid microgrid energy management system, an optimisation approach called spider monkey optimization (SMO) is employed. Using their distinct fission and fusion techniques, spider monkeys always engage in natural foraging behavior. Here, a variety of common constraints related to PV, wind, energy storage elements, inverters, and diesel generators with a variety of cost functions and dimensions are resolved by the proposed optimization method. The SMO optimization method is used to find a utilitarian optimal hybrid energy system configuration with a minimum COE, minimum LPSP, and leading renewable factor to meet the customer load throughout the entire time horizon.