Thinking in particular about European colonial explorers in North America, but I imagine this happened elsewhere too. If the language was completely different, how did they learn? How long would it take to learn a language that no-one you knew had ever heard, let alone spoken? Were there explorers who specialized in linguistics or learning new languages?
Generally speaking, language barriers weren’t as big as people tend to assume they were. Chances are that before meeting, they will already share a mutual language, or know someone who knows both, so they were able to communicate with each other through some lingua franca. Trade networks were large and complex enough that there was bound to be a middleman of some sorts to ease communications.
More can be said if anyone wishes to add something new, but in the meantime you may enjoy reading:
and more from the FAQ section on Cross-Cultural Communication.
In situations like Columbus—an unusual and unlikely instance where neither group had heard of the other and there was a language barrier at first—then immersion effected language learning: signing, gesturing, context clues, pantomiming, etc. helped people build a vocabulary that let them communicate, verbally and physically (sometimes, if necessary, actions spoke louder than words). Someone was eventually able to figure out the other's language, and they were able to serve as a translator. I don't have details on specific incidents of language learning in these situations (maybe someone can pop in with that), but if you can imagine someone approaching you, mimicking the action of eating, and you pointing them where to find food and they do it—or perhaps, someone pointing to bones and saying the word klaka until you figure out that's the word for bone, and then you continue learning when they point to a river and say klinrona—you can understand the basics of how people without a shared language were able to communicate. It's essentially an elongated, more complex version of that process.