Mobile ad hoc networks (MANETs) are subjected to attack detection for transmitting and creating new messages or existing message modifications. The attacker on another node evaluates the forging activity in the message directly or indirectly. Every node sends short packets in a MANET environment with its identifier, location on the map, and time through beacons. The attackers on the network broadcast the warning message using faked coordinates, providing the appearance of a network collision. Similarly, MANET degrades the channel utilization performance. Performance highly affects network performance through security algorithms. This paper developed a trust management technique called Enhanced Beacon Trust Management with Hybrid Optimization (EBTM-Hyopt) for efficient cluster head selection and malicious node detection. It tries to build trust among connected nodes and may improve security by requiring every participating node to develop and distribute genuine, accurate, and trustworthy material across the network. Specifically, optimized cluster head election is done periodically to reduce and balance the energy consumption to improve the lifetime network. The cluster head election optimization is based on hybridizing Particle Swarm Optimization (PSO) and Gravitational Search Optimization Algorithm (GSOA) concepts to enable and ensure reliable routing. Simulation results show that the proposed EBTM-HYOPT outperforms the state-of-theart trust model in terms of 297.99 kbps of throughput, 46.34% of PDR, 13% of energy consumption, 165.6 kbps of packet loss, 67.49% of end-to-end delay, and 16.34% of packet length.