Learning the basics like "Hello", "How are you?", "Thank you" and "I'm sorry" are the most important ones and definitely the most polite! Most of the time with greetings, the other person will realize you're not fluent in the language and avoid replying in too much detail. If they do, smile and mention that your skill in said language isn't that good ("I'm sorry, my ____ is very bad.") You should definitely ask "Do you speak English?" because they might know just enough to help you out and make it easier to communicate. Going to different places is probably going to be an important part of your trip, so questions like "How do I get to______?" and "Where can I get something to eat?" are essential to keep in your arsenal; as is "Where is the nearest bathroom?" It might also be a good idea to familiarize yourself with streets and directions as best you can, particularly since cab drivers know they can take a bit of a longer route without you noticing to grab extra fare. Learning how to ask "How much does this cost?" followed by "Can you give me a better price?" at a busy market can score you a deal simply because you asked. People around the world are much more comfortable with haggling than North Americans, so they'll likely be surprised you asked, especially in the local language, and cut you some slack.Carrying around a dictionary with you everywhere isn't the worst idea, but remember you have a powerful tool that can do the same thing for you: your phone! Mobile apps can be a great help for new languages when you're on the go as well as learning before you leave. Apps like DuoLingo and Rosetta Stone can walk you through comprehensive language lessons with practical words and phrases, proper grammar, and a chance to test out your pronunciation. Apps like iTranslate and Google Translate offer on-the-go translations so you can find the word you need quickly and easily. At the end of the day, you're not expected to become fluent in the local language of the places you visit (unless you want to - and speaking multiple languages is always a plus!) but being able to communicate simple things makes your trip a lot smoother, safer and all around more interesting; being able to talk to more people will make for some great discoveries and awesome stories.
In many tourist destinations, they anticipate English as the de facto language of most of their travellers and do their best to accommodate. This may not always be the case, however, and it then becomes important that you know at least a few important phrases in the local language. No matter where you're headed and what language they speak, there's plenty of resources for you to learn the language just enough to get simple tasks done.