Rotary joint is used in robotic arm for mobility aids and rehabilitation device. The rotary joint often requires a compactness, a lightness, and a large load capacity in robotics as well as automation manufacturing. However, the experience-based design methods take a lot of time, finances, and human resources to achieve the mentioned multiple functions. To overcome the above difficulties, the article proposes a new design technique to solve the structural optimization for the rotary joint. The proposed optimization technique is formed by topology method, analysis of variance, finite element method, adaptive neuro-fuzzy inference system model, and water cycle moth-flame optimization algorithm. A new rotary joint is designed via the topology optimization. The adaptive neuro-fuzzy inference system is optimized by Taguchi technique to enhance the modeling accuracy. The geometry of the joint is optimized by the water cycle moth-flame optimization algorithm. The results found that the rotary joint can stand a torque of 357.46 N.mm with the equivalent stress up to 489.98 MPa. The difference between the optimal prediction results and simulations are 0.27% and 0.58% for the moment reaction and the equivalent stress, respectively. The small error proves the developed hybrid method has a high reliability.