This research has a research object, namely the optimization of the LEACH (Low-Energy Adaptive Clustering Hierarchy) algorithm in the context of wireless sensor networks. The problem in this research is the imbalance in energy consumption across clusters, which has an impact on battery life and affects network performance. Other problems include selecting a cluster head that is not focused so that it is difficult to balance network performance as well as computational limitations that require optimization. The results obtained from this research are in the form of optimizing the leaching algorithm by modifying the clustering-based leaching algorithm that will be used in wireless sensor networks. In carrying out modifications, this research uses several stages in the process of selecting sensor nodes that will become members who function as cluster heads in a cluster that will be used in a wireless sensor network. In the LEACH (Low-Energy Adaptive Clustering Hierarchy) algorithm the cluster head will be selected based on the modified probability value. Modifying the algorithm by considering two factors, namely distance and remaining energy used in the Cluster Head selection process on the network and increasing network usage time must be based on the energy consumption used and then compared with the remaining energy. When modifying the LEACH (Low-Energy Adaptive Clustering Hierarchy) algorithm, it is necessary to pay attention to the distance factor between the nodes on a sensor and the selected cluster so that it can result in increased network performance. Network lifetime is indicated by the average death time of the first Node in the network. This research is novel in producing a modified leaching algorithm by improving network performance and extending battery life so that it can be used for wireless sensor networks in the context of natural disaster mitigation