But if the the king is more advanced you can't defend on the 6th rank.
You could still defend checking from the side if you have at least 3 files difference between your rook and the pawn, but it's tricky and requires accurate moves; such as which side to put your king etc.
You can simply use the Lasker's defence, that works in every situation.
Only one thing to be careful with: your rook needs to control the pawn at all times:
I was reviewing the 2 video series on here, both by Danny and by Melik, about rook endings.
For how to draw simple positions they talk a lot about the drawing method in which you have to check from the side, the "rook on long side, king on short side" and "wait on the 8th". However this defence fails if there's less than 3 files space in the "long side".
While it is useful to learn these concepts, especially because you might be facing them from the attacking side, I then realized that there is NEVER any need to defend from the side.
Simple Philidor's defence:
(continues....)