When the Jews left Judea for Babylon, they spoke Hebrew, but during their 70 years in Babylon, they adopted Aramaic, the language of both Assyria and Babylon.
Around 600 B.C. Babylon launched a series of assaults on Judea. By about 585 B.C. the Babylonians had conquered Judea, killed many people, and carried the best and brightest away to Babylon. After 70 years, Babylon was itself conquered by the Persians, who allowed those Jews who wanted to go to return to Jerusalem.
When the Jews (mostly consisting of the tribes of Judah, Levi, and Benjamin) left Judea for Babylon, they spoke Hebrew, but during their 70 years in Babylon, they adopted Aramaic, the language of both Assyria and Babylon. By forgetting Hebrew, they made it difficult to read the scriptures. This difficulty led to the rise of Jewish sages and scribes, who not only could write contracts and perform other legal services but could read the scriptures in Hebrew and expound on them. Most people who encountered Jesus thought He was a scribe but they were startled that He also spoke with authority.
Around 330 B.C. Alexander the Great of Macedon (northern Greece) conquered the known world, even down into Egypt and east to India. When that happened, Greek traders and tradesmen moved around the Greek empire with their families and the language and culture of the Holy Land became Greek. Greek was the language of the marketplace all over the empire. Remember the story of Antony and Cleopatra, the Queen of Egypt? Cleopatra wasn’t Egyptian, she was Greek. Look at your map of Israel at the time of Christ and you will see many towns and cities with Greek names.
Then the Roman empire grew to conquer and replace the Greek empire. The Romans spoke Latin. When Jesus was born, He was surrounded by family and neighbors who spoke Aramaic. To read the scriptures, He had to know Hebrew. To interact with Gentiles and participate in the marketplace, He had to speak Greek. To interact with Roman officials, He had to speak Latin. We can suppose that because of Jesus’ godliness He had the gift of tongues and through the Holy Spirit could communicate well in any situation.