A compass can be working perfectly while leading you away from your base. Minecraft has several navigation tools with different targets. Before following the needle across another mountain, identify which target you actually asked it to find.
This guide covers ordinary vanilla Survival mechanics. Server plugins and modded recipes may differ. The examples are planning scenarios, not claims of a tested route through your world.
A normal compass does not remember your bedroom

In the Overworld, an ordinary compass points toward world spawn. It does not change its destination simply because you slept at a distant base. In the Nether or the End, that ordinary compass cannot provide the same useful direction.
Suppose your first shelter was near world spawn, but you later moved to a village several journeys away. Following the original compass still makes sense for reaching the starting area. The mistake is treating that starting area and your new home as the same destination. Before leaving the village, record a route or coordinates, or prepare a compass linked to a lodestone there.
Do this while you still know where you are. A new navigation tool cannot reconstruct an unrecorded journey just because the journey has become inconvenient. If you are already lost, first preserve your current position and any landmarks you recognize; avoid turning one uncertain route into several.
A lodestone compass needs a surviving destination in the same dimension

Place a lodestone at the destination and use a compass on it. That linked compass points back to the block while you are in its dimension. If the block is destroyed, or you are in another dimension, the link no longer supplies a useful direction. These restrictions are described in Mojang’s lodestone guide.
For a Nether expedition, a sensible destination is the Nether side of your return portal. A lodestone in the Overworld house does not guide you across the Nether to that portal. Label your compasses by destination and dimension so two visually similar tools do not become a guessing game.
Older crafting advice can also send you on an unnecessary resource hunt. Java 1.21.5 changed the recipe to one iron ingot surrounded by eight chiseled stone bricks. Bedrock 1.21.60 also introduced the iron-based recipe. Check your installed version before following an older netherite recipe; do not assume a modpack follows either vanilla recipe.
A recovery compass finds a death location, not a guaranteed pile of items

A recovery compass points to your most recent death location in the same dimension. If you have not died, or are in a different dimension, it spins instead. Keep it at your recovery base rather than carrying your only one into danger: losing it with the equipment you want to recover defeats its purpose.
The needle identifies a location; it does not certify that the dropped equipment survives. Mojang’s death guide explains that dropped items have limited loaded time before disappearing, and hazards such as lava can destroy equipment. Following the arrow is therefore a navigation step, not a recovery guarantee.
Before departing, finish this sentence: “This compass should take me to ___, in ___.” If the answer is your base, link the right destination. If it is your last death, prepare the recovery kit. If it is world spawn, use the ordinary tool. That small distinction prevents a long walk toward the wrong answer.
Independent guide by Quest & Checkpoint. Not an official Minecraft publication; not approved by or associated with Mojang or Microsoft.