Energy is an important parameter in establishing various communications types in the sensor-based IoT. Sensors usually possess low-energy and non-rechargeable batteries since these sensors are often applied in places and applications that cannot be recharged. The most important objective of the present study is to minimize the energy consumption of sensors and increase the IoT network's lifetime by applying multi-objective optimization algorithms when selecting cluster heads and routing between cluster heads for transferring data to the base station. In the present article, after distributing the sensor nodes in the network, the type-2 fuzzy algorithm has been employed to select the cluster heads and also the genetic algorithm has been used to create a tree between the cluster heads and base station. After selecting the cluster heads, the normal nodes become cluster members and send their data to the cluster head. After collecting and aggregating the data by the cluster heads, the data is transferred to the base station from the path specified by the genetic algorithm. The proposed algorithm was implemented with MATLAB simulator and compared with LEACH, MB-CBCCP, and DCABGA protocols, the simulation results indicate the better performance of the proposed algorithm in different environments compared to the mentioned protocols. Due to the limited energy in the sensor-based IoT and the fact that they cannot be recharged in most applications, the use of multi-objective optimization algorithms in the design and implementation of routing and clustering algorithms has a significant impact on the increase in the lifetime of these networks.