Set user role using Select feild

I have a form that I want to use to set user roles, since I know that the user role is stored in “wp_capabilities” iam able to change this value using update user meta. The problem is that it’s stored in a serialised format in the database and I can’t get it to be stored the right way, if I set the value as serialised in pro form, it just can’t store it as is. Kindly offer some insight