A compass is not able to tell you where your destination is, but it can help guide you back home if necessary.
You can navigate using three different methods:
By landmarks
By magnetic North (using the compass)
By stars
These are objects you recognize immediately when you come across them. They can include buildings, trees, rivers, and others. Because they give you a visual clue about where you are, landmarks are very useful.
Magnetic North is simply where the Earth's electromagnetic field points. The sun appears to be moving across sky if you look up. However, the earth’s magnetic field actually causes it to move around the Earth. While it may appear that the sun moves across the sky, in fact, the sun actually moves around its horizon. The sun is directly overhead at noon. At midnight, the sun will be directly below you. Because the earth's magnetic field changes constantly, the exact direction of its magnetic North pole is always changing. This means you might be off the course by quite a bit during a single day.
Another method of navigating is using stars. Stars appear over the horizon to rise and lower. These are fixed points in space that you can use to determine your location relative to other locations.