A node localization algorithm using the Jaya algorithm (JA) and range-free method of reliable anchor pair (RAP) selection approach is proposed to determine the position of target nodes or unknown devices in isotropic, O-shaped, and S-shaped anisotropic wireless sensor networks (WSNs). The reliable anchor selection method separates anchor nodes into prime anchor node pairs, subprime anchor node pairs, and unreachable anchor node pairs to determine the distance between anchor node pairs and target nodes. The nature-inspired Jaya algorithm is used to predict the position of the target node. The presented work is compared with the existing localization methods, including DV(Distance Vector)-maxHop, PSO (Particle Swarm Optimization), and QSSA (Quantized Salp Swarm Algorithm) based localization algorithms. The proposed approach increases localization accuracy regarding the number of anchor nodes and node density. The proposed algorithm also looks at how the degree of irregularity and computation time affect the performance.