Efforts are being made worldwide to reduce carbon emissions in order to mitigate global warming. The production of hydrogen using renewable and sustainable energy sources could be an important step in zero carbon emission initiatives. This paper investigates the potential of solar–wind-battery based hybrid microgrid energy architecture for powering a hydrogen production plant to produce 150 kg of hydrogen daily. The plant is proposed to be located in Teknaf, Cox's Bazar, Bangladesh. The optimal solution of microgrid design is based on the criteria of energy costs, meeting demand requirements, and limiting excess electricity. The optimal design includes 2.6 MW of solar panels and five 100 kW wind turbines. This integrated system adeptly meets the target energy demand while demonstrating surplus electricity generation of 11.9% through a detailed analysis of various operational scenarios. The paper highlights the economic viability of the microgrid considering both installation and operating costs. The positive environmental impact is evident with an estimated reduction of around 2278 tons of carbon dioxide emissions, emphasizing its role in promoting green and sustainable energy practices.