The inefficiency of the localization process mostly causes delays and operational difficulties in wireless sensor network (WSN) topologies. When localization is suboptimal, the time required for path creation significantly increases, leading to reduced network lifetime and diminished routing efficiency. To address these critical issues, our research focuses on developing a novel procedure that optimizes routing and localization. In this context, localization is the initial step for reaching sensor terminals, followed by activating the routing mechanism. To tackle these issues in Underwater Wireless Sensor Networks (UWSN), the proposed work presents the Elman Bat-based Hello Routing (EBbHR). The primary objective of our research is to locate wireless sensor nodes within the designed UWSN effectively. The process is initiated to achieve this by creating the necessary wireless sensor hubs within the MATLAB Simulink environment. Subsequently, the novel EBbHR function is activated to facilitate the precise localization of all sensor hubs, thereby enhancing the overall data transmission. The success of the designed EBbHR is assessed by considering UWSN factors, and a comparison with current approaches is carried out to show the advancements made by the model.