Remove User Role Programmatically?

How to remove user roles prgramatically? I understand that we can add user roles with this

image

but how about removing them?

I tried this

image

but an error prompts
image

I solved it…here are the codes