Climate change is known as a serious threat to the human species, and its significance should be considered in building design. This study aims to investigate the relationship between energy consumption and CO2 emission in Iran during the years 2018–2019 using artificial neural networks (ANNs) and regression methods. The input data were gathered and optimized by the particle swarm optimization (PSO) algorithm. Lighting, equipment load rate, wall U-value, roof U-value and people density were deliberated as effective parameters. Afterwards, the ANN was created, trained and tested by the radial basis function (RBF) algorithm; also, the data were evaluated based on statistical analysis in SPSS software. The results demonstrated R2 = 0.99 and the 45-degree line for the predicted value. Energy consumption and CO2 were reduced to 35% and 73.21%, respectively. Furthermore, CO2 emissions and energy consumption had an inverse relationship with infiltration rates (−0.201) and (−0.098). Furthermore, CO2 emission and energy consumption had a linear relation in Iran with the equation of y = 1.63x + 0.52. Moreover, based on ANOVA test, R2 linear was 0.985 and R = 0.993, illustrating significant accuracy. Architects and designers could enjoy these findings as guidelines for renovation and designing purposes so as to alleviate the negative environmental impacts of construction.