Master Linguist (5e Optimized Character Build)
From D&D Wiki
Ever wanted to learn (nearly) every language possible without being a Level 13 Monk or using the spell comprehend languages? Well, now you can!
Start by choosing a Half-Elf as your race, giving you three languages, then choose Acolyte, Cloistered Scholar or Sage as your background, giving you two languages.
For feats, choose Linguist and Prodigy, which will give you 4 more languages (3 from Linguist and 1 from Prodigy). Also choose Observant, so you'll be able to interpret the speech of any creature.
As for classes, pour 14 levels into Ranger. Favored Enemy gives you a language depending on the creature you choose, meaning you'll get 3 more languages by level 14. Now add one level into Druid so you'll learn Druidic and one level to Cleric, choosing the Knowledge Domain which will give you two more languages. Finally put 3 levels into Rogue, choosing the Mastermind archetype which will grant you 3 additional languages.
With this, you'll learn almost every language (18 out of 22, according to this list by level 19. However, despite this, you can still communicate with pretty much everything depending on what languages you choose. I recommend choosing Primordial since (if memory serves correct) Terran, Auran, Aquan and Ignan are dialects of Primordial, meaning you're essentially learning 4 languages at once.