This paper investigates the optimal design of a hybrid renewable energy system, integrating wind turbines, solar photovoltaic systems, biomass, and battery and hydrogen storage to ensure a reliable energy supply at the lowest annual cost for a residential load in Kern County, USA. The hybrid generic algorithm particle swarm optimization (GAPSO) algorithm was adopted to determine the optimal configuration of parameters and cost-effectiveness, considering technical, economic, environmental, and social performance indicators. The generic algorithm (GA) and particle swarm optimization (PSO) validate the effectiveness of the proposed technique, showcasing its efficiency in system optimization. The findings indicate that GAPSO outperforms GA and PSO due to its rapid convergence, lowest final fitness value, and stable optimization process. The hybrid GAPSO's performance, combined with the different capacities of wind turbines (4,561 kW), solar PV (8,480 kW), biomass (2,261 kW), battery banks (8,000 kWh), and fuel cells (2,392 kW), resulted in an annual cost of $6,239,193; energy cost and net present value of $0.48/kWh and $101,333,937. The system maintained a supply loss of 0.8%, achieved an availability index of 99.2%, a renewable energy fraction of 88.87%, GHGs emission of 953615 kg, land use of 3842875 m2, and water consumption 528678 L respectively. GAPSO achieved a 2.17% and 0.01% improvement in cost-effectiveness and 11.11% increase in reliability compared to GA and PSO.