Objective of this study is to develop a novel, effective, and robust Sliding Mode Control (SMC) method for quadcopters (also called quadrotors) based on Adaptive Neuro-Fuzzy Inference System (ANFIS) for the purposes of enhancing trajectory tracking performance and realizing safe and reliable flight. In the paper, the ANFIS was combined with SMC technology to propose a scheme of adaptive robust controller, which is composed of three sub-controllers, x position controller, y position controller, and z position (altitude) controller. The proposed method can realize position tracking control of quadcopters in the presence of external disturbances. With the help of ANFIS, an adjustable gain rather than a fixed gain was established for the SMC controller, the optimal output could be attained based on a set of rules, and the position control gain was updated by ANFIS, enabling the SMC to adapt to environmental changes. Through modelling, simulation and comparison, experimental data verified that the proposed ANFIS-SMC controller outperformed conventional SMC controller in terms of convergence speed, robustness, accuracy, and stability with a maximum mean error of 0.125 meters in trajectory tracking. Research findings of this paper could contribute to the development of robust and responsive control strategies for Unmanned aerial vehicles (UAVs) trajectory tracking by providing valuable insights into the design of more effective and efficient control systems for UAVs, particularly in the context of dynamic environmental conditions.