Take one of the many regular buses to Trat from either the Eastern Bus Terminal (Ekamai) or the Northern Bus Terminal (Moh Chit). Direct 1st class buses from Ekamai average a bit more than 5 hours, the less frequent frequent services from Moh Chit take a little less. 2nd class buses take a lot longer as they make more stops and use slower and less direct routes.
From Trat, take a minibus direct to the Hat Lek border crossing, where you can cross into Cambodia and take a moto or share taxi to Koh Kong and organize the next part of your trip.
Cross the border and enjoy Cambodia but be aware that the border opens at 07:00 and closes at 20:00. If you want to go on directly to Sihanoukville by sea, keep in mind that the boat leaves at 08:00.