Optimization is a common phenomenon that we encounter in our daily routine, which involves selecting the best option from a set of alternatives. A lot of algorithms have been developed, including metaheuristics algorithms, which aim to find solutions close to optimal to solve optimization problems. Many metaheuristic algorithms have been inspired by the behavior of natural phenomena, animals, and biological sciences. This paper proposes a novel nature-based metaheuristic optimization algorithm called Adaptive Fox Optimization (AFOX) Algorithm, which is inspired by the hunting behavior of foxes. The proposed algorithm enhances the FOX algorithm by balancing the exploration and exploitation phases, speeding up convergence to the global solution, and avoiding local optima. The efficacy of the AFOX algorithm was tested on eight classical benchmark functions, the functions of CEC2018, and the functions of the CEC2019 Benchmarks. Moreover, AFOX was applied to solve real-world optimization problems, such as prediction and engineering design problems, and compared with a wide range of metaheuristic algorithms such as variant versions of FOX, the Dragon-Fly Algorithm, particle swarm optimization, Fitness Dependent Optimizer, Grey Wolf Optimization, Whale Optimization Algorithm, Chimp Optimization Algorithm, Butterfly Optimization Algorithm, and Genetic Algorithm. The results demonstrate the effectiveness of the AFOX algorithm in finding optimal solutions with higher accuracy and faster convergence. Thus, the AFOX algorithm is deemed to be highly efficient in solving real-world optimization problems with accuracy and speed.