This study investigates the potential of using phase change material (PCM) in a building using an air handling unit (AHU) assisted by solar energy. To further enhance the system, an energy storage system (ESS) can be considered. Implementing ESS would allow the captured solar energy to be stored efficiently, ensuring a continuous and reliable power source for cooling or heating the air, even during non‐sunlight hours. The air‐conditioned zone is considered to be 220 m2 in which 30 people work for 12 h a day. An energy analysis is conducted to evaluate the performance of the proposed system in terms of energy and exergy loss. The genetic algorithm (GA) method is used to optimize the system. The results indicate that the system, including PCM and solar system, can reduce energy consumption by up to 8.9% compared to conventional AHUs in the hottest month of the year (July). The results indicated that employing PCM leads to a decrease of 124 kWh in heat loss during January and 229 kWh in heat gain during July. Taking into account the beneficial impacts of both PCM and the solar system, the yearly assessment demonstrates a 2.69% reduction in power demand, equating to an energy saving of 679 kWh. Furthermore, PCM in the proposed system can be used in integration with AHUs based on renewable energy systems to store renewable energy for buildings.