In Minecraft it’s easy to get lost. Unlike in other games, there is no proper map in the corner of the screen and the environment can look quite repetitive at times.
Yes, F3 is always there to provide you coordinates, but if you want to play the game the old way, you should never go on an adventure without a Compass.

How to get it
A Compass can naturally generate in Shipwrecks, Strongholds and Villages.
You can also craft a Compass. You will need 4 Iron Ingots, Redstone Dust and place them in the Crafting Table as follows.

Otherwise, you can obtain a Compass using commands by typing: /give @p minecraft:compass 1
What it does
By default, Minecraft Compass will always point towards the world Spawn Point, where you started the game.
Using a Compass to craft an Empty Map
A Compass can be used to craft an Empty Map by combining it with Paper.

Using the Empty Map will make it fill with the surroundings of where it is being used:

An Empty Map can also be used to copy other maps, such as Buried Tresure Maps:

Lodestone Compass
A Lodestone is a block that can be used to change where a Compass points. In fact, by right-clicking on a Lodestone while holding a Compass in your hand will turn the Compass in a Lodestone Compass. This will now always point towards the Lodestone used in the process instead of your Spawn point. It will also start glowing purple.

If the Lodestone is destroyed, its Lodestone Compass will just spin randomly. This will continue even if you replace the Lodestone.
For crafting a Lodestone you will need 4 Ancient Debris, 4 Gold Ingots and 8 Chiseled Stone Bricks. To get the Ancient Debris you’ll need to mine them in the Nether, you can find them at Y levels between 8 and 22. You’ll need to use a Diamond Pickaxe for this task.
Crafting a Lodestone
First step, smelt the debris in a Furnace to obtain 4 Netherite Scraps.

Then craft a Netherite Ingot using the Netherite Scraps and the Gold Ingots.

Check here how to make Chiseled Stone Bricks. And the last step to craft the Lodestone:

Now you can place the Lodestone by right-clicking while holding it in your hand and use it to make a Lodestone Compass. As stated before, to do so you need to right-click on the Lodestone while holding the Compass in your hand.
Miscellaneous
- A Compass will point towards your Spawn point (or its Lodestone) even when dropped as an item
- in the Nether a Compass will not work, it will just spin randomly. This will happen in the End as well
- in the Bedrock edition, Lodestone Compasses glow Blue
- Compasses can be traded with Cartographers in villages in exchange of Ocean Explorer Maps and Woodland Explorer Maps
- it can only be enchanted with the Curse of Vanishing. In multyplayer it could be a good idea to enchant a Lodestone Compass with it. This way if an enemy player kills you, they won’t be able to use your Compass and find the Lodestone it is linked to (assuming that your Lodestone would be in an important place)
- ts Namespaced ID is compass
- in the Java Edition its its translational key is item.minecraft.compass (or item.minecraft.lodestone_compass)
- In the Bedrock edition of its Numeric ID is 345 and its translational key is item.compass.name (or 741 and item.lodestonecompass.name)
- it is in Minecraft since the 1.0.0 version of 2011.