A wireless sensor network is a type of wireless ad-hoc networks, which is a collection of individual sensor nodes that are battery-operated devices and connected through ad-hoc and self-configuring connectivity. Therefore, the energy-saving of sensor node is a challenging design issue. Hence, the lifetime of a node is decreased. To enhance the network lifetime and optimal energy consumption, clustering is one of the best methods in WSN. While message transmission there is more distance between the cluster head and base station then more energy drained by the cluster head compare to the remaining sensor nodes in a particular cluster and if the energy consumption is more then automatically the network lifetime decreased. Therefore, this paper proposed an optimal metaheuristic firefly based cluster head selection protocol (FCH) by finding fitness value for selecting the best cluster head. This best-elected cluster head drains less energy as well as increase the network lifetime. In addition to the proposed FCH compared with two basic sensor networks algorithms low energy adaptive clustering hierarchy (LEACH) and Data transmission (DT). The FCH algorithm achieved better results than compared algorithms in terms of dead nodes, remaining energy, and alive nodes of the network.