Picture a pawn's square in your mind: one side is the distance from the pawn to its promotion square. If the enemy king can step into this square it catches the pawn; if not, the pawn becomes a queen.
White to move. If you push the pawn, the square shrinks and the black king can't get into it. But if you play anything else, the king enters the square. Play the right move.
Black to move. The square of the h5 pawn has corners e5, h5, h8 and e8. If your king steps into it in one move, it catches the pawn. Choose the right square.
Remember: if the pawn is still on its starting square, it can move two squares, so draw the square from one rank further. And always take into account whose move it is.