The kings cannot stand next to each other
When the kings stand on the same file or rank with one square between them, direct close opposition arises. Other things being equal, the side that does not have to move forces the other king to step aside first.
This is not a separate rule of chess, and it is not an automatic win. The basis is the ordinary ban on placing a king where it is attacked; the practical result depends on the pawns, spare moves and key squares.
Sources: FIDE · Laws of Chess, edition in force from 1 January 2023
One square between the kings
The white king stands on e4, the black king on e6. The square e5 is unavailable to both: the other king controls it. If it is White's move, White cannot simply step the king straight forward.
The pawn on d4 is a reminder that geometry alone is not enough: a pawn move can change whose turn it is, but it also changes the position itself. The whole endgame has to be judged.
Count the squares, rather than repeat a slogan
First choose the square the king wants to reach. Then check which replies block the way. This will show whether it helps to keep the opposition or whether it is better to give it up and outflank the opposing king.
When studying an ending, change only whose turn it is to move and compare the variations. That experience quickly shows the difference between knowing the definition and understanding the position.
Sources and verification
The texts are DUEL's editorial account. Tournament results have been checked against the official publications cited.