Humanoid robots possess remarkable mobility and adaptability for diverse environments. Nonetheless, accurate walking pattern tracking remains challenging, especially when employing the linear quadratic regulator (LQR) due to delays in high-mobility setpoint tracking. We propose a novel control approach to address this limitation by integrating an artificial neuro-fuzzy inference system (ANFIS) with the LQR to enhance pattern tracking. The research contributes to developing a control system that combines LQR and ANFIS to enable humanoid robots to follow various walking patterns with increased precision and efficiency and also the scheme to incorporate LQR and ANFIS. The study involves four experiments: step response, walking phase, static straight walking, and varied straight walking. Each test runs for 5 seconds with a 100-millisecond sampling rate, repeated five times, and employs the Integral Absolute Value (IAE) metric for evaluation. The LQR-ANFIS method exhibits superior performance, achieving a maximum overshoot of 0%, a rise time of 0.3 seconds, a settling time of 0.3 seconds, and a steady-state error of 0% in the step response experiment. The proposed control system also enables stable walking with step periods ranging from 0.15 to 4 seconds and step ranges of 0.05 to 0.03 meters. In conclusion, the integration of ANFIS with the LQR significantly enhances the mobility of humanoid robots, enabling them to navigate diverse environments and accurately track various walking patterns proficiently.