In modern times, security remains a significant concern in wireless networks. Wireless sensor networks are widely employed in different practical situations. WSNs struggle with numerous internal and external threats, and detecting and defending against insider attacks is difficult. Insider attacks, in which intruders discard received data packets selectively, pose a significant risk to WSNs. The presence of black hole nodes within the network causes this issue. This research paper presents a secure and reliable route management methodology for WSNs that selects nodes and routing paths based on trust metrics. The proposed mechanism employs intelligent routing and node selection to defend against various types of assaults encountered during the routing process, including selective forwarding and black hole attacks. As a result, the paper identifies secure routes and establishes secure network routing. This scheme uses throughput, latency, and packet drop ratio as performance metrics. Experimentation demonstrates that the proposed system effectively increases the probability of secure network routing paths while extending the network lifecycle.