1. It is necessary to run at least a single payroll to notify the Leaver to the HMRC and generate the Form P45. (If there is no pay you may run zero payrolls)
2. Once done you may download the P45 by following the below link
Reports>> Additional Forms>> P45
Watch here how to record an employee as leaving and generate P45