Localization in wireless sensor networks (WSNs) is used to determine the coordinates of the sensor nodes deployed in the sensing field. It is the process that determines the location of the target nodes relative to the location of deployed anchor nodes. These anchor nodes are deployed at known locations having GPS installed in them. However, mostly in all 3D applications, the area under observation may have a complexity in the sensing environment. In this work, a modified learning enthusiasm-based teaching learning based optimization algorithm (LebTLBO) is proposed to deal with the 3D localization problem using single anchor and moving target nodes in anisotropic network with DOI 0.01. LebTLBO is a metaheuristic inspired by the classroom teaching and learning method of teaching learning based optimization algorithm. An improved LebTLBO algorithm aims to achieve enhanced performance by balancing the exploration and exploitation capabilities of conventional LebTLBO to improve its global performance. On the CEC2019 benchmark functions, the suggested technique is assessed, and computational findings show that it provides promising outcomes over other competitive algorithms. Also, mLebTLBO outperforms well in terms of localization error in 3D environment. The proposed technique is useful to cope up in case of rescue operations. This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and reproduction in any medium, provided the original work is properly cited.