Not a 5.24 player, but I might steal good ideas from this thread. In my opinion, one of the weaknesses the Ranger has is lackluster defenses; if they switch-hit, shields are out, so their AC is never great, they can't benefit from HAM, they have no damage resistances except Absorb Elements, they have no innate disengage or Uncanny dodge aside from Vanish, etc.
Instant Step
2nd level
As a reaction, when you are struck by an attack made by an enemy you can see, you may cast this spell. A creature of your choice within 5' of you must make a Wisdom saving throw. On a failure, you switch places with it, and it becomes the target of the attack made against you. The original attack and damage rolls are still used.
This is gives a way to get out of an attack and damage enemies, and it plays well with the theme across many Ranger subclasses of engaging multiple foes at once (Hunter Multishot, Horizon Walker's extra attack when it spreads its damage around, etc.). You can also flavor it as a non-magical cunning reposition if you prefer.
Foe Shield
1st level, Concentration up to 1 minute
For the duration of this spell, you have resistance to all damage dealt to you by creatures which qualify as your Favored Enemies.
Makes the "Is good against specific enemies" class actually defended against its special enemies. Boosts defenses and beats out the trash that is Hunter's Mark.