Deploying and effectively utilizing wireless sensor networks (WSNs) in underwater habitats remains a challenging task. In underwater wireless sensors networks (UWSNs), the availability of a continuous energy source for communicating with nodes is either very costly or is prohibited due to the marine life law enforcement agencies. So, in order to address this issue, we present a Q-learning-based approach to designing an energy-efficient medium access control (MAC) protocol for UWSNs through collision avoidance. The main goal is to prolong the network’s lifespan by optimizing the communication methods, specifically focusing on improving the energy efficiency of the MAC protocols. Factors affecting the energy consumption in communication are adjustments to the interference ranges, i.e., changing frequencies repeatedly to obtain optimal communication; data packet retransmissions in case of a false acknowledgment; and data packet collision occurrences in the channel. Our chosen protocol stands out by enabling sensor (Rx) nodes to avoid collisions without needing extra communication or prior interference knowledge. According to the results obtained through simulations, our protocol may increase the network’s performance in terms of network throughput by up to 23% when compared to benchmark protocols depending on the typical traffic load. It simultaneously decreases end-to-end latency, increases the packet delivery ratio (PDR), boosts channel usage, and lessens packet collisions by over 38%. All these gains result in minimizing the network’s energy consumption, with a proportional gain.