The achievement of sustainable energy goals warrants keen interest in promoting efficient buildings and renewable energy resources. Prominent among the energy-efficient building technologies is geothermal energy, which has a significant margin for improving energy utilization related to Heat, Ventilation, and Air Conditioning (HVAC). However, the efficient extraction of geothermal energy for HVAC applications requires stringent control of geometric parameters, boundary conditions, and environmental conditions. In this study a new approach has been devised to optimize the open loop Earth to Air Heat Exchanger (EAHE) system using a statistical optimization technique i.e., Response Surface Method (RSM). The study was conducted in the soil and weather conditions of Peshawar city in Pakistan. Parametric analysis was conducted for the three influencing variables, i.e., the pipe length, diameter, and air velocity using the EAHE model. The soil model predicts temperature in the range 20–26 °C for Peshawar at a depth above 3 m. Response Surface method was used to optimize the pipe length, diameter, and air velocity of the EAHE system. Analysis of Variance (ANOVA) indicates that all the three factors are significant. The EAHE system can effectively reduce the temperature by 15–18 °C and compensate the cooling load of single room for the parameters in the ranges of 50–70 m for the length, 0.18–0.25 m for the diameter, and 5–7 ms−1 for the air velocity. A regression equation is developed to predict the cooling load for any input values of the three influencing variables according to the weather and soil conditions.