With the emergence of Wireless Sensor Networks (WSNs), a large number of academics have worked over the last several decades to increase energy efficiency and clustering. Several clustering algorithm techniques, including optimization-based, fuzzy logic-based, and threshold-based, were created to minimize energy consumption and improve network performance. Optimization algorithms such as Particle Swarm Optimization (PSO), Genetic Algorithm (GA), and Ant Colony Optimization (ACO), and their variants are presented. But the challenge of selecting the efficient Cluster Head (CH) and cluster formation around it with minimal overhead and energy consumption remains the same. We propose a novel energy-efficient and lightweight clustering technique for WSNs based on the Modified Bacterial Foraging Optimization Algorithm (MBFA). In this study, the goal of developing the MBFA is to reduce energy consumption, communication overhead, and enhance network performance. The MBFA-based CH selection procedure is based on a unique fitness function. The fitness function computes essential characteristics such as remaining energy, node degree, and distance from sensor node to Base Station (BS). Using the fitness value, the MBFA identifies the sensor node as CH. To justify efficiency, the suggested clustering protocol is simulated and tested against state-of-the-art protocols.