Wild at heart, with martial training to spare, the Ranger is Nature’s Warrior. L ike the fighter and paladin, Rangers have various fighting styles to choose from and a multitude of subclasses. Rangers of 5th Edition come in many flavors.
Your two basic subclasses are the Beastmaster and the Hunter.

The Beastmaster is all about animals, namely your ‘companion.’ You get to choose what beast is your companion, and your proficiency bonus buffs its natural abilities. In combat it acts as an extension of you: a weapon that you verbally control with your action. If you become incapacitated your furry friend can act on their own to defend you and fight back. Should the unfortunate happen and you beast dies, you must spend a full eight hours finding and bonding with a new animal. The progression of attacks and bonus actions increases as you level, but for the most part this subclass is considered to be rather weak. There is a revised ranger subclass of Beastmaster available through the playtest material of the Unearthed Arcana articles.

The other basic option is the Hunter. They are trained in dealing with all manner of wilderness threats, both small and large. Most players find that the Colossus Slayer option is the way to go, adding damage to an already injured foe. Giant Killer and Horde Breaker are useful, but seem a little too setting specific to see much general use. Growing in power presents more options in the way of Escape the Horde, which allows you to avoid opportunity attacks for a more hit-and-run style of play: Multiattack Defense, which increases your AC after you’ve been hit once in a multi-attack –allowing you to stand your ground and tank, or Steel Will, which hardens your saving throw versus being frightened. More advanced levels grant you abilities in attacking multiple foes with Volley or Whirlwind Attack. A few final options round out the subclass: Uncanny Dodge or Evasion, both from the rogue skill sets, or Stand Against the Tide, which allows you to redirect a foe’s missed attack,
Xanathar’s Guide to Everything offers three more choices of Ranger: Gloom Stalker, Horizon Walker, and Monster Slayer.

The first of these three, The Gloom Stalker, is a master of hunting in the shadows. Whether deep in the Underdark or the shadowy alleys of Baldur’s Gate, this ranger is at home wear light fears to tread. They begin combat swiftly, adding their wisdom modifier to their initiative, and gain extra attacks, movement, and damage on the first round of combat. They can gain darkvision and are adept at evading those that have it. Their minds become strengthened in regard to wisdom saving throws, and their combat skills allow them extra attacks when they miss or to cloak themselves in shadow, forcing foes to roll with disadvanatage.

The Horizon Walker is an extra planar guardian. They are adept at finding planar portals, and dealing extra force damage to their foes. As their power grows they gain the ability to enter the Ethereal plane, and even teleport in combat. Even the boundaries of the planes themselves are no match for a high level Horizon Walker as they can slip between them in combat to mitigate some of the incoming damage.
Finally we have the Monster Slayer. They are highly skilled at ferreting out the weaknesses and resistances of their opponents. They can focus their attacks on a specific foe doing extra damage. This focus grants them a bonus to their saving throws, and grapple checks versus this foe at higher levels. An odd toss in here is their ability to force a wisdom save as they attempt to counter either a spell or teleportation attempt at higher levels. This can only be used once per long rest, but it might prove rather useful in a dire situation. Finally, when their targeted foe forces them to make a saving throw they gain a reactionary attack, that if it hits, causes their save to automatically succeed.
Couple these subclasses with wisdom-based spellcasting and Rangers are a formidable addition to any party!