There is an article written on this topic by Zendesk so the link is below.
In summary there are three stages:
- Reassign the agent's tickets
- Downgrade the agent's role
- Suspend the agent's account
However, there are various things to check along the way so I'd advise following the Zendesk article on removing agents.