If you're currently listed as a director, then send a recorded delivery (preferably signed for) letter, dated with date of writing & sending and clearly stating your resignation date, addressed to and sent to the board of directors at the official registered office address, this should suffice as far as the cessation of your dates of responsibility in that director role.
Consider before you write that letter to write yourself a letter (if authorised) under that company heading, giving a reason why you need to leave, (perhaps unsuitable changes in current market/financial situation) and that's the one to produce at One stop when handing back work permit and or at Immigration when looking for another visa.
But please consider seeking legal advice, as good legal advice is worth it's weight in gold.