As the amount of low-cost and low-power sensor nodes increases, so does the size of a wireless sensor network (WSN). Using self-organization, the sensor nodes all connect to one another to form a wireless network. Sensor gadgets are thought to be extremely difficult to recharge in unfavourable conditions. Moreover, network longevity, coverage area, scheduling, and data aggregation are the major issues of WSNs. Furthermore, the ability to extend the life of the network, as well as the dependability and scalability of sensor nodes' data transmissions, demonstrate the success of data aggregation. As a result, clustering methods are thought to be ideal for making the most efficient use of resources while also requiring less energy. All sensor nodes in a cluster communicate with each other via a cluster head (CH) node. Any clustering algorithm's primary responsibility in these situations is to select the ideal CH for solving the variety of limitations, such as minimising energy consumption and delay. Kinetic Gas Molecule Optimization (KGMO) is used in this paper to create a new model for selecting CH to improve network lifetime and energy. Gas molecule agents move through a search space in pursuit of an optimal solution while considering characteristics like energy, distance, and delay as objective functions. On average, the KGMO algorithm results in a 20% increase in network life expectancy and a 19.84% increase in energy stability compared to the traditional technique Bacterial Foraging Optimization Algorithm (BFO).