The ability to navigate autonomously from the start to its final goal is the crucial key to mobile robots. To ensure complete navigation, it is mandatory to do heavy programming since this task is composed of several subtasks such as path planning, localization, and obstacle avoidance. This paper simplifies this heavy process by making the robot more intelligent. The robot will acquire the navigation policy from an expert in navigation using machine learning. We used the expert A*, which is characterized by generating an optimal trajectory. In the context of robotics, learning from demonstration (LFD) will allow robots, in general, to acquire new skills by imitating the behavior of an expert. The expert will navigate in different environments, and our robot will try to learn its navigation strategy by linking states and suitable actions taken. We find that our robot acquires the navigation policy given by A* very well. Several tests were simulated with environments of different complexity and obstacle distributions to evaluate the flexibility and efficiency of the proposed strategies. The experimental results demonstrate the reliability and effectiveness of the proposed method.