Purpose This study aims to optimize the energy consumption of residential buildings in mild and humid climates. It investigates the use of thermal insulation to reduce thermal load through energy simulation analysis. Design/methodology/approach A residential building located in Rasht city, Iran (a mild and humid climate zone), is simulated using DesignBuilder software. Subsequently, the minimum thermal resistance for external walls and roof is analyzed along with its impact on building energy consumption and carbon emissions. Findings The simulation results indicated a 26.5% reduction in heat loss through the walls and a 14.2% reduction through the roof due to optimal thermal insulation. Furthermore, optimal insulation led to a 19.2% reduction in cooling system energy use, a 12% reduction in heating system energy use and a combined 15.3% reduction in total energy consumption for cooling and heating. Originality/value This optimization process leads to several benefits: reduced costs associated with thermal and cooling energy losses in buildings, improved building performance against atmospheric factors and, ultimately, a reduction in energy consumption across the building industry. This research can be valuable to various stakeholders, including the construction industry and building sector, municipalities and engineering systems, building owners and contractors and environmental organizations. By implementing these findings, they can improve the state of modern building insulation and achieve greater energy efficiency.