The best-known rule for traversing mazes is the wall follower, also known as either the left-hand rule or the right-hand rule. If the maze is simply connected, that is, all its walls are connected together or to the maze's outer boundary, then by keeping one hand in contact with one wall of the maze the solver is guaranteed not to get lost and will reach a different exit if there is one; otherwise, the algorithm will return to the entrance having traversed every corridor next to that connected section of walls at least once. (Wikipedia - Maze-solving_algorithm).
Use the following image and draw a line attached to the wall using red dots.
Watch this video a micromouse competition to get out of a maze.
First it does a reconnaissance and then it gets to the center very quickly.
It would be interesting to try it with Arduino.