In recent years, our life has become broader and faster by adapting to the Internet of Things (IoT). In IoT, the devices distributed globally that are connected to the Internet improve productivity in various sectors. The network plays an important role for transferring data to the sink node by collecting from all other nodes in IoT. The IoT requires energy saving since it is connected to resource-constrained devices. Energy preservation is a difficult challenge to improve network lifetime in IoT. Clustering is one of the key techniques to extend the network’s life. In that, cluster head selection is one of the promising techniques to extend the lifespan of the IoT network. Many researchers proposed various cluster head (CH) selection techniques in IoT. However, inappropriate CH selection quickly degrades a network battery and creates an energy-hole problem in the network. This paper proposes a novel sandpiper optimization algorithm (SOA) to select CH among the networks. Later, the cluster is formed by using the Euclidean distance. The proposed SOA’s accomplishments are compared to fitness value-based improved grey wolf optimization (FIGWO), particle swarm optimization (PSO), artificial bee colony-SD (ABC-SD), and improved artificial bee colony (IABC). The proposed SOA extends the network lifespan by 3-18% and increases the throughput by 6-10%. Thus, the proposed SOA increases the network lifetime and throughput and decreases the energy consumption among the nodes in the network.