The Internet of things, an outstanding scientific technology in the current computational society, is usually made of intelligent electronic gadgets and sensing devices. IoT focuses on the interaction and communication of objects to extract human necessities. Wireless sensor networks have become the pivotal architecture for building the efficient and rigid functionality of the IoT. Usually, a wireless sensor network performs its activities based on the nodes established in the network. The node explicitly exhibits various attributes like sensing the signals, computing complex computations, and other wireless computing strategies over the web. The sensor node in the network transmits data and information using numerous available transmission techniques. It optimizes the routines from available routes over the network path. Optimizing the working span of WSN (Wireless Sensor Networks) is essential. This paper elucidates the optimization techniques to improve network sensors' performance and lifespan ratios in a reliable and stable network. Hence, the proposed mechanisms soundly speak about reinforcement learning and fuzzy logic systems from ML (Machine Learning). Both these variants work based on the types of available wireless nodes, the energies from the nodes, the existing bandwidth, and non-reliable distances between the nodes (sink). The paper also compares the proposed techniques using IEEE protocols and the fuzzy logic approach. The outset of the presentation reveals the optimized-enhanced lifespan and power consumption of WSNs through OPNET (Optimum Network Performance).