Press F3 on your keyboard
Look for the XYZ coordinates in the debug screen
On some laptops, press Fn + F3
If your keyboard has function lock enabled, use the appropriate F3 key combination
In Java Edition, coordinates are shown only through the debug screen by default
