Wireless sensor networks (WSNs) have attracted significant attention because of their widespread use in health care, habitat tracking, disaster prevention, agriculture, monitoring areas, fire tracking, and other real-life applications. The lifetime of WSNs must be prolonged to increase their use for various applications. One of the most effective methods for improving the network's lifetime is clustering with the optimal cluster head (CH). This study proposes a fuzzy Logic (FL) low-energy adaptive clustering hierarchy (LEACH) technique-based particle swarm optimization (PSO). It employs hybrid PSO and a K-means clustering algorithm for cluster formation. It selects the primary CH (PCH) and secondary CH (SCH) using FL. Extensive simulations were conducted using a simulation program to validate the proposed protocol's performance. Furthermore, the proposed protocol was compared with traditional algorithms, such as fuzzy c-means (FCM) clustering and FLS-based CH selection to enhance the sustainability of WSNs for environmental monitoring applications, LEACH-Fuzzy clustering protocol, and LEACH based on energy consumption equilibrium. The results confirmed that the proposed protocol efficiently balances energy consumption to improve wireless sensor network performance and to maximize throughput. The simulated results indicated that network lifetime was improved by more than 46% and packet transmission by 17.6%.