Protection
A piece is loose when the opponent can take it and you cannot recapture. You can save it by moving it, or by putting a friend on a square that recaptures if it is taken.
Moving away is best when the piece has a safe square. Defending is what you do when the unit should stay where it is, which is often a pawn.
Step off the attacked file
The black rook attacks the white rook on h1. Rg1 leaves the file. The rook is no longer hanging.
Defend the attacked pawn
The pawn on d5 attacks e4. The rook cannot take that pawn, so it steps to e1 and defends e4 from behind. If Black takes, Rxe4 recaptures.