''what is the best class?'' is one hard to awnser question if you ask me, because every class has it's upsides and downsides. Like mellee is fairly strong end game but is very weak at begin / mid game. or magic doesn't require you to spend money on expensive gear / ammo.
Ranged is probably still the way to go since the high damage and quite dps output along with it's huge range to keep distance and capabilities to dodge attacks with ease (no movement penalties) along with decent armor. rangers ussually don't have alot of regen to keep them alive as you do want to deal as much damage as possible.
But then again the machine rug set is now also a thing and the set is pretty good for magic and mellee classes as it offers damage, armor and slight endurance just enough to keep most attacks and specials going.
but if i would have to make a list of the ''best'' classes in every stage of the game it would be:
Early game - Magic 100% (ranged and cheap)
Ranged (very expensive, low dps)
Mellee (Dark souls 3 mode, you'll die alot)
Mid game - Magic (decent damage, still cheap, intresting armor sets)
Ranged (High damage, rather expensive)
Mellee (Hardcore mode, but you'll learn how to dodge attacks)
End game - Mellee (insane survival capabilities while also dealing high damage)
Ranged (high damage and armor, can be combined with alot of sets)
Magic (Low damage, movement penalties, low armor)
''Hybird'' (Varies, most commonly seen with GRL and Forgotten life)