The company file a Form B10 with the CRO stating that you have resigned and that someone else has been appointed and the directors sign it.
BUT you need to ensure that this is a genuine resignation - not putting someone else in your place and continuing on running the company as an employee in order to qualify for a relief of some kind.