Attack and king safety
Do not open your own shelter
Before taking with a shelter pawn, trace the rook or bishop line the pawn would leave. A pawn gain can cost all the remaining cover.
Worked example
Position in text
Black to move. White: pawn h4, pawn f2, rook f1, king g1. Black: king g8, rook h8, pawn g6, bishop d5.
FEN: 6kr/8/6p1/3b4/7P/8/5P2/5RK1 b - - 0 1
Black offers a pawn with 1...g5. If White grabs it with 2.hxg5, the h4-pawn leaves the h-file and 2...Rh1# follows. The bishop on d5 guards h1 and g2, and White’s rook and pawn fill f1 and f2. Taking the pawn changes a harmless rook on h8 into a mate in one.
A plausible mistake
Do not count your f1-rook as a free defender when the checking rook lands next to your king. There is no square between h1 and g1 on which to block.
Try it yourself
Position in text
White to move. White: pawn h4, pawn f2, rook f1, king g1. Black: king g8, rook h8, bishop d5, pawn g5.
FEN: 6kr/8/8/3b2p1/7P/8/5P2/5RK1 w - - 0 2
After 1...g5, compare the capture with 2.f3. What happens to the h-file if Black replies 2...gxh4?
Check your answer
2.f3 leaves the h-pawn in place, and 2...gxh4 replaces it with a black pawn on h4. The h8-rook has no direct check down the file. Black retains pressure, but White has avoided the immediate mate and opened f2 for the king where legal.