You can use a lodestone to alter the direction a compass points to in Minecraft. The traditional location the compass indicates for players is the world spawn. By placing a compass on a lodestone, it now directs you to the stone. You can do this to ensure you don’t lose a particularly rare resource, and can freely return to an ideal location yo want to remember.
There are two ways for you to obtain a lodestone. The first option is to loot a bastion remnant in the Nether. These large, castle-like structures have Piglins that spawn all over and inside it, ready to defend the location from any players. The chests on the bridge or inside the structure’s treasure room have a 100 percent chance of containing a lodestone inside of them. While guaranteed, these encounters will not be easy to survive, and you will want to proceed with caution. Bastion remnants generate in the Crimson Forest, Nether Wastes, Soul Sand Valley, and Warped Forest.
Alternatively, you can craft one. A lodestone requires eight chiseled stone bricks and one Netherite ingot. To create chiseled stone bricks, you need to craft three stone blocks to turn them into stone slabs, and then use those stone slabs to turn them into a stone brick. After you have all of your chiseled stone bricks, you need to create a Netherite ingot, which requires mining Ancient Debris from the Nether and smelting it down into Netherite scraps and gold ingots.
With all of your ingredients, go to your crafting station to craft your lodestone to place down at any location you wish to return to using a compass. You will need to mine the lodestone with a pickaxe to move it to different locations in Minecraft.