the best time is winter in Europe (between December and April) but you can go all year without problems.
The temperature is almost constantly around 27 ° C on the coast, both in air and in water!
Getting to Sri Lanka, an ETA visa (Electronic Travel Authorization) is required to enter the country. It is obtained online by internet on the "eta.gov.lk." The site offers a page in english and includes 3 parts to complete but it is not complicated. ETA is valid for 3 months from its issue. Warning: Your passport must have a period of validity of 6 months. Consulate and the Embassy of Sri Lanka in your country can provide information if needed.