The rule of the square is a shortcut that tells you instantly whether a lone king can catch a running passed pawn — no move-by-move calculation needed.
Imagine a square whose side runs from the pawn to its promotion square (along the file). Extend that square sideways across the board. If the defending king is inside that square, or can step into it on its move, it catches the pawn. If it can't reach the square, the pawn promotes.
If it's the pawn's side to move, the pawn effectively gets a head start — shrink the square by one. If it's the defending king's move, it gets to step in first. Always account for whose turn it is.
In king-and-pawn races and many endgames you must decide in a glance whether to chase a pawn or push your own. The rule of the square turns a tense calculation into a simple visual check.
Watch for pawns on their starting square — they can move two squares, so the 'square' starts from the square ahead of the pawn. And a friendly king or piece blocking the defender can change everything.