Vehicular ad hoc networks (VANET) are one of the advanced technologies for distributing dynamic vehicular information across the globe. The VANET is extensively used in many applications, especially road safety applications and intelligent transport systems (ITS). However, direct communication causes high bandwidth (BW) requirement and power consumption. Hence, this article introduces a clustering‐based mechanism to communicate vehicles with infrastructures. The cluster head (CH) is formed based on certain rules, and nodes or vehicles are combined. But, maintaining stability remains challenging for the traditional clustering mechanism. Moreover, the developed technique must examine the malicious and reduce the risk of fake information sharing. This research emphasizes a trust‐based clustering mechanism to select the CH based on a vehicle's knowledge, reputation, and experience. In addition to this, the backup head is also analyzed to promote trust in each vehicle. After clustering, secure routing is undertaken. For this, a bionic remora optimization algorithm (BROA) is proposed, and it considers the hop Count Field as well as the transmission range of vehicles to select the best routes. The performance measures such as end‐to‐end delay ratio, packet delivery ratio (PDR), throughput, trust values, energy consumption are analyzed and compared with existing techniques. In an experimental scenario, the proposed technique has an end‐to‐end delay of 3.8 ms, PDR of 98%, trust value of .4 and .06 for wormhole and Sybil attack, energy of and throughput of 78.7 kbps are attained. The outcome results prove the efficacy of a proposed method.