In many editions of D&D, everyone learns a handful of languages at character creation, and then either never thinks about them again or never has the one they need. I propose an alternative, with 5e as a base.
Characters learn fewer languages.
Everyone knows common. There are no racial languages. Only learn a second language if your background calls for it.
Each language satisfies a narrative function.
Common—common is great. Everyone knows common unless there's something strange happening. Don't think about it.
Ancient—dead civilizations speak and write this language. You might know it if you're a treasure hunter, a time traveler, or a classics major.
Ceremonial—this language is a secret for religious or magical reasons, like Druidic or Hebrew. From a world-building perspective, I'd limit myself to one of these per setting, even if that requires some contortion.
Underworld—this language is a secret for reasons of discretion, like Polari or rhyming slang. Dialects change, but learning on-the-fly is built-in to its rhythms. Written, this is the ability to read hobo signs, notice graffiti, etc.
Technical—this is how experts in a field talk about stuff. Even if you're a published author on the topic of applied divination, you can still muddle through someone's notes on optimal well-drilling or drop some convincing techno-babble.
Otherworldly—aliens and old Gods speak this. (Angels, devils, and other outsiders speak common: they want you to understand them.)
Foreign—someday you will find yourself somewhere where they only speak French. Until then, it's a social signifier of a misspent education, a party trick or a bit of flavor.