Minecraft wiki entry for Tips_and_tricks, associated text: North can be found by hitting a block and checking the directions of the cracks which occur on a block as it is mined.
This may not work if a resource pack that changes the crack pattern is being used.
First, learn the crack pattern. If a block is hit on its side, there should be one crack going almost straight up, one to the right, and one going almost straight down.
If a block on the ground is hit, the same crack pattern will appear. The crack which went almost straight up on the side of the block, will point north on the top of a block.
You can watch which direction the sun, moon, stars, or clouds are moving. Each of these always moves from east to west.
In the Java Edition, the debug screen (activated by pressing F3) gives information on which way the player is facing.
If you have a map (In Bedrock Edition, a locator map) covering where you are, the map will show an arrow-like player icon. This points the same way that you are facing in the world. The top of the map is north, the right edge is east, and so on.