Among the most common and extensively operated methods in wireless sensor networks (WSN) to increase the efficiency and performance of WSN is network clustering because, through this solution, data is transmitted through the closest possible path. In the clustering method, a portion of the nodes in the network become cluster heads, then a cluster is formed by joining the nodes close to the cluster head. However, the main and important problem in this issue is preventing the creation of unbalanced clusters since the spreading of cluster heads in the network can be unequal. In this paper, we have presented an algorithm based on the discrete Gorilla Troops Optimizer (DGTOA) algorithm and K-Means with a fuzzy clustering approach. In this model, first, several cluster heads are chosen by applying the discrete DGTOA algorithm, and then the output of the DGTOA algorithm is given as initial points and coordinates in K-means. Finally, the cluster head is utilized to wield the fuzzy system. Also, different criteria and graphs were used to compare the proposed model, and the obtained results were measured with other methods, and the obtained outcomes indicate the high performance of the proposed model.