Attack and king safety
The king walks out
When a flank is exposed, route your king toward friendly pieces and away from the attacker’s last checking line. Do not precommit to a walk before seeing the checks.
Worked example
Position in text
White to move. White: pawn e3, rook b1, king g1. Black: king g8, rook h8, queen a5.
FEN: 6kr/8/8/q7/8/4P3/8/1R4K1 w - - 0 1
White can leave g1 with 1.Kf2. Black can follow with 1...Rh2+, but the rook attacks along rank two, not rank three. White can answer 2.Kf3. The queen can then transfer from a5 to h5 with check, so the escape is not finished. The e3-pawn does not block that diagonal; it is useful as a friendly anchor once the king steps away.
A plausible mistake
A legal first king move does not prove the route is safe. After every candidate move, test checks by the pieces that can change files or diagonals quickly.
Try it yourself
Position in text
White to move. White: pawn e3, king f3, rook b1. Black: king g8, queen h5, rook h2.
FEN: 6k1/8/8/7q/8/4PK2/7r/1R6 w - - 4 3
After 2...Qh5+, is 3.Ke4 legal? Compare it with dropping back to f2.
Check your answer
3.Ke4 is legal. The queen checks on h5–g4–f3–e2, not e4, and the rook on h2 does not cover rank four. 3.Kf2 is illegal because the rook still controls the second rank. This does not establish the ending’s outcome; it shows a concrete way to stay ahead of those two lines.