The applications based on the wireless sensor network (WSN) work with a large quantity of tiny battery-powered sensors. It has always been a problem for WSNs that sensor node has such a short battery life, and efficient management of the sensors' energy is essential for improving their overall performance. For the network's energy issues, the clustering approach has proven to be a successful solution. To address energy concerns, clustering divides the network area into different clusters. In this paper, a clustering protocol based on the fuzzy logic model and particle swarm optimization (PSO) is proposed to improve the lifespan and performance of the entire network and is named as fuzzy logic and PSO-based energy efficient clustering (FLPSOC). The proposed protocol uses the fuzzy logic model to appoint the most efficient node for the cluster head (CH) job. The fuzzy model considers the neighbor count, energy ratio (initial energy and residual energy), and distance to neighbors as the input parameters in the fuzzy system for the CH selection procedure. The data gathered by the CH are transmitted to the base station (BS) by using the relay nodes. In the proposed scheme, most optimal nodes for relay task are selected using the PSO technique, which considers residual energy of CH and distance between the CH and BS parameters. Performance measures such as network lifespan, stability period, throughput, and CH count are used to determine how efficient the proposed algorithm is in comparison with other existing protocols.