Separation formalities, the person can apply to the unit in advance to leave, or can negotiate with the unit, if the unit has violated the law, you can just leave.
After that, the employer shall issue a certificate of termination of the labor contract or termination of the labor contract at the time of termination, and within fifteen days for the transfer of files and social insurance relations for the workers.
According to the Law of the People's Republic of China on Labor Contracts
Article 36 The employer and the worker may terminate the labor contract by consensus.
Article 37 A worker may terminate an employment contract by giving the employer thirty days' written notice in advance. A worker may terminate an employment contract by giving three days' notice to the employer during the probationary period.
Article 38 A worker may terminate an employment contract if the employer does any of the following:
(1) fails to provide labor protection or labor conditions as agreed in the employment contract;
(2) fails to pay labor remuneration in full and in a timely manner;
(3) fails to pay social insurance premiums for the worker in accordance with the law;
(4) Where the rules and regulations of the employer are in violation of laws and regulations, to the detriment of the rights and interests of the workers;
(e) Where the labor contract is invalidated due to the circumstances stipulated in the first paragraph of Article 26 of this Law;
(f) In other cases where the laws and administrative regulations stipulate that the workers may terminate the labor contract.
If an employer forces a worker to work by violence, threat, or unlawful restriction of personal freedom, or if an employer commands or orders risky work in violation of regulations, endangering the personal safety of the worker, the worker may terminate the employment contract immediately without prior notice to the employer.
Article 50 The employer shall issue a certificate of termination of the labor contract at the time of termination, and shall handle the transfer of files and social insurance relations for the worker within fifteen days.
Laborers shall handle the handover of work in accordance with the agreement of both parties. If the employer shall pay economic compensation to the laborer in accordance with the relevant provisions of this Law, it shall be paid at the time of completing the handover of work.
The employer shall keep the text of the canceled or terminated labor contract for at least two years for inspection.