There are different types and configurations of mazes. For example, in some it is to reach a certain position, such as the center, in others it is to find an exit. The latter type raises questions like, how many exits are there, and how many entrances.
If you Google on "maze algorithm" you will find those matters discussed i the first few hits, at least I did.
An old and simple algorithm for one entrance, one exit is to always keep one hand on the right (or left) wall. It's not efficient, but it will work. At least the author in Scientific American said it would, but that was many years ago. John
Edit: modified algorithm to be clearer.