In Thailand there are two coasts, the Gulf of Thailand and the Andaman Sea. Being brief and taking as reference two very suitable destinations, Krabi (Andaman Sea) and Koh Samui (Gulf of Thailand), our suggestion is as follows:
January. Krabi or Koh Samui, both options are good.
February. Krabi or Koh Samui.
March. Krabi or Koh Samui.
April. Krabi or Koh Samui.
May*. Krabi
June. Koh Samui
July. Koh Samui
August. Koh Samui
September. Koh Samui
October*.
November. Krabi See also Koh Chang in the Gulf of Thailand.
December. Krabi and Koh Samui.
* May and October
Officially the change of season for the beginning of the monsoon occurs in mid-May and five months later, in mid-October, a new dry season begins.
However, these are general patterns and monsoons can both be advanced or delayed.
In May, the expectation is not very different between Koh Samui and Krabi, although we prefer Krabi because, in our opinion, if there is luck, the beaches are impressive here.
In any case, advance the stage of the beaches if the trip is long and allows you to approach April (in general, it is better to start in Bangkok and finish on the beaches).
In the month of October there is no big difference to recommend one destination or another. As the monsoons are going to finish, it is convenient to leave the beach stage for the end, as close as possible to November.
And then, may luck be with you.
Link to What is your ideal beach?