Java Edition: press F3 to open the debug screen and view your coordinates
Bedrock Edition: enable Show Coordinates in World Settings
On some consoles: use the in-game map or HUD settings if Show Coordinates is available
On mobile: enable Show Coordinates in the world settings
Your coordinates are shown as X, Y, and Z
X = east/west position
Y = height
Z = north/south position
