Firstly, the immediate superior along with the HR boss must talk to the concerned employee to assess the reason for leaving. If the employee is valuable and has a genuine grievance, then the organization should find a solution to retain them. The reasons for leaving should be documented during an exit interview for future reference, and any necessary corrective action should be initiated.
If the situation is different, inform the employee about the notice period and ask them to serve it if deemed necessary by the organization. Ensure that the full and final settlement along with other relieving formalities is taken care of.