Use the NLME_LeaveReq() function.
For making a remote node to leave the network, the extAddr pointer of the NLME_LeaveReq_t parameter shall be assigned to the remote node 64 bit IEEE address. The address of a remote node can be retrieved during association process by processing the Device_annce message as shown in "#How to get the address of new devices joining the network".
For making the local node to leave the network, the extAddr pointer of the NLME_LeaveReq_t parameter shall be assigned as NULL.