The ranger in Dungeons & Dragons Fifth Edition has an unfortunate reputation as the weakest class in the game. Despite its flaws, the ranger is a versatile class with many potential playstyles. Rangers can focus on ranged or melee attacks or even have animal companions join them in battle.
Source:https://www.cbr.com/dnd-best-ranger-magic-items-5e/