Attack and king safety
Keep the h-pawn pinned to its king
A pawn pinned to its king cannot capture off the file. Check where the king actually stands before trusting a g-pawn advance.
Worked example
Position in text
White to move. White: pawn g4, king c1, rook h1. Black: king h8, pawn f7, pawn g7, pawn h6.
FEN: 7k/5pp1/7p/8/6P1/8/8/2K4R w - - 0 1
White’s rook on h1 sees up to the h6-pawn; the king is behind it on h8. After 1.g5, 1...hxg5 is illegal because it would clear the h-file and expose the king. Black can still play other legal moves, and a retreat or block can end the pin on a future turn.
A plausible mistake
Do not say the h6-pawn cannot move at all. Advancing 1...h5 keeps it on the line, and it can be legal if the destination is empty.
Try it yourself
Position in text
White to move. White: pawn g4, king c1, rook h1. Black: king g8, pawn f7, pawn g7, pawn h6.
FEN: 6k1/5pp1/7p/8/6P1/8/8/2K4R w - - 0 1
Now Black’s king is on g8 rather than h8. Can the h6-pawn capture after 1.g5, and what changed?
Check your answer
Yes: 1...hxg5 is legal. The rook now controls the h-file without pointing at the black king. Clearing that line may be strategically dangerous for Black, but the absolute pin has vanished.