Take a look at a membership plugin https://ultimatemember.com/ such as Ultimate Member or forms plugin such as gravity forms https://gravityforms.com/
Hi, is there a way to code manually for the registration form because I have tried all the plugins but they did not meet my requirement.
Gravity Forms paired with their User Registration plugin allows you to assign the role to the user upon successful signup. I’d suggest against letting users select their own ROLE that can lead to a lot of problems, especially hacking attempts, which will slow down your site.
That said, yes. If you insist on writing a custom plugin you can review https://codex.ww.wp.xz.cn/Customizing_the_Registration_Form.
Hope this helps. Once you find a solution you are happy with please tag the thread as resolved.
My apologies, I just reread your original post and realized that you were already planning to only allow admin to change role.
You can do this on the edit user screen under the admin area.
Go to Users → All Users
then hover over the user you want to edit and you will see an option to edit their profile.
I think that paired with one of those other plugins will do exactly what you are needing! 🙂
Hope this helps more than my previous post.