Check
The king is in check when it is attacked by an enemy piece. A check must be resolved on the very next move: move the king, block the attacking line, or capture the attacker. Making a move that leaves your own king in check is illegal — which is exactly why checks are such a strong tactical weapon.
Start
—
Stockfish 18 · runs locally in your browser
1…
Three ways to answer a check — move the king, block the line, capture the attacker. Here the king simply steps off the g-file.