Believe it or not, one of the best ways to learn the language of a foreign county is to start out with a brief course of that language. Here it is important to grasp some of the basics, with the emphasis upon speaking and listening to the pronunciations of the basic words that are in common use.
As a side-note, I also wrote an article on using Apps to learning a language.
If you can master some of the basics, you can practice with the people of that country while you are visiting, such as at the markets, bazaars and restaurants.
Look for a language school or course where the emphasis is on conversation. With modern technology and digital availability, you can download podcasts and digital formats of just the types of instruction materials that you will need.
When you can hear and practice the words and phrases that you will be using, you will be able to carry on a rudimentary conversation when you get to that country.
For instance, if you are going to be traveling to South America, you can specify the country you will be visiting and study seriously for a couple of weeks. While you are still going to be very limited, the people will really help you out when you get there. When they discover that you know as much as you, they are going to be anxious to help you learn more.
The key to success in learning the language of any country is to exercise your use of what you have studied outside of the classroom. That is where the advantage of using it with the inhabitants of the country you are visiting is so important.
The classroom prepares you, and the actual use of the language with the people when you arrive, finishes you out. Your real expansion and use of the language occurs when you engage in conversation with the natives.