The zero-energy building, also known as Net-Zero Energy Building (NZEB), is based on the concept of an energy-efficient building that balances its total energy using solutions that aim to mitigate CO2 emissions and reduce energy use in the constructions. Energy consumption in residential and commercial buildings increased between 20% and 40% in developed countries and exceeded the industry and transportation sectors. Due to climate change, by 2050 buildings can consume 20% more energy, with energy performance being the critical element in achieving climate goals and improving energy security. The objective of this paper is to maximize the thermal comfort in an NZEB through the evolutionary algorithm PSO (Particle Swarm Optimization), a technique inspired by the collective intelligence of the animals. For this, different constructive parameters were inserted in a geometric model to identify combinations that offer greater comfort. For the optimization problem of this work, the design parameters were: block type, concrete thickness used in the solid slab, mortar type, window size, door size, and cover type. From the geometric model, an IDF file was generated for the parameterization and subsequent energy simulation of the scenarios created by the PSO in the EnergyPlus software. The exchange of materials and parameter values of the model reached lower hours of discomfort per year in comparison to results obtained in the literature.