You don't necessarily have to choose one or the other.

The thing to keep in mind about multiclassing is that it's not really about what you miss out on at higher levels, but more about what the build you want gains from hitting certain levels in a respective class. In general, most multiclass setups will end up being stronger if they are planned out accordingly.

Since you are asking about Warlock vs. Ranger, you obviously like both. So why not do both?

As an example, here's a build I just beat Honour Mode with:

Raven Queen Warlock Ranger

This build is primarily a stealth archer but uses
Band of the Mystic Scoundrel
late game for powerful Warlock crowd control effects. Super fun build to play, and viable on the highest difficulties.

It's also a Warlock build that (gasp) does not use Eldritch Blast, because your bow attacks are more powerful. Don't be afraid to get creative.