@Maud **********
there is nothing you need to do at immigration before you leave.
If you have an extension of stay, and you want to return to Thailand before the extension of stay expires, you need a reentry permit.
If you have an extension of stay, such as employment, and you are not returning to Thailand, you need to cancel it before you leave.