Wireless Sensor Networks (WSNs) are extensively used in event monitoring and tracking, particularly in scenarios that require minimal human intervention. However, a key challenge in WSNs is the short lifespan of sensor nodes (SN), as continuous sensing leads to rapid battery depletion. In high-traffic areas, sensors located near the sink node exhaust their energy quickly, creating an energy-hole issue. As a result, optimizing energy usage is a significant challenge for WSN-assisted applications. To address this, this paper proposes an Energy-aware Routing and Cluster Head Selection in Wireless Sensor Network through an Attentive Dual Residual Generative Adversarial Network for Golden Search Optimization Algorithm in Wireless Sensor Network (EAR-WSN-ADRGAN-GSOA). This method involves selecting the Cluster Head (CH) using Attentive Dual Residual Generative Adversarial Network (ADRGAN), minimizing energy consumption, and reducing a number of dead sensor nodes. Subsequently, Golden Search Optimization Algorithm (GSOA) is employed to determine an optimal path for data transmission to the sink node, maximizing energy efficiency, and elongating sensor node lifespan. The proposed EAR-WSN-ADRGAN-GSOA method is simulated in MATLAB. The performance metrics, such as network lifetime, number of alive nodes, number of dead nodes, throughput, energy consumption, and packet delivery ratio is examined. The proposed EAR-WSN-ADRGAN-GSOA demonstrates improved performance, achieving a higher average throughput of 0.93 Mbps, and lower average energy consumption of 0.39 mJ compared with the existing methods. These improvements have significant real-world implications for enhancing the efficiency and longevity of WSNs in applications, such as environmental monitoring, smart cities, and industrial automation.