You need to get a visa cancellation letter from your employer and submit to the immigration for the immigration to put a cancellation stamp and date on your current visa.
Later when you apply for a new visa, there could be problems that you didn't cancel your previous visa
You can cancel your visa 21 days before the visa cancellation letter by giving immigration the visa cancellation letter.
The immigration will put your last date of stay until the visa cancellation date. But, you can exit Thailand before the visa cancellation date too and if you want you can come back on a tourist visa back in just a day.