The official languages
With an alphabet comprised of 52 letters that don't correspond at all to our latin alphabet, Sinhala is one of the country's two official languages, along with Tamil. If you must choose to learn only one before your trip to Sri Lanka, it should be Sinhala. It is spoken by 75% of the population. You therefore have more chance to use it than Tamil, which is spoken by only 25% of Sri Lankans.
To be honest, learning either one of them is fairly complex other than the standard greetings and a few common words; it will be very difficult for you to learn much more.
Even by just knowing how to say "hello", "ayuboan" in Sinhala and "vanakkan" in Tamil, you will do an honour to your hosts, who will appreciate your having made the effort. Learning how to count can also be worthwhile, especially as it's not that difficult.
Switching to English
It's only fair to tell you that even if you make all the effort in the world, it will be impossible for you to carry on an in-depth conversation in either Tamil or Sinhala. However, about 15% of the population speak English. This is the case for most of the people who come into contact with tourists. So you are in luck! You will be understood everywhere you go. So you will be able to make the most of these wonderful encounters, especially since the Sri Lankans are generally very welcoming. They love to chat with visitors and practice their English.