Underwater wireless sensor networks have a wide range of application prospects in important fields such as ocean exploration and underwater environment monitoring. However, the influence of complex underwater environments makes underwater wireless sensor networks subject to many limitations, such as resource limitation, channel openness, malicious attacks, and other problems. To address the above issues, we propose a routing scheme for underwater wireless networks based on a trust model and Void-Avoided algorithm. The proposed scheme establishes a trust model, evaluates the behavior of underwater nodes through direct trust, indirect trust, and environmental trust, and finds malicious nodes while taking into account evaluation of the channel, which provides support for the next data transmission event. The proposed scheme prioritizes the total cabling distance and introduces a two-hop availability checking model for data transmission, checking the nodes for voids and avoiding the void areas, to find the transmission path with the lowest energy consumption and lowest latency as much as possible. In this study, simulation experiments were conducted on the proposed scheme, and the results showed that the target scheme can effectively detect malicious nodes through anomalous behaviors and outperforms existing work in terms of malicious node detection rate, energy consumption, and end-to-end latency, and network performance.