Also note that even if you unroot your andriod device, you may still have issues if you are using TWRN recovery or any other custom recovery.
To unroot your device use any of below method:
- Unrooting via superSU, SuperUser, KingUser Etc.
- Using universal Unroot
- Flashing Stock Rom
This depend on how your phone was rooted, check the phone app drawer to know which SU app was installed
For SuperSu go to settings scrow down to Clean up and select Full unroot
For KingUser go to Settings by clicking the gear icon then tap on Remove Root Permission and hit the clear Button
Reboot Your phone when it all Done.
If the above method fails there is a super app in play store its called Universal Unroot, Download it and get the android device Unroot
This should be your last option because its not advisable to this unless you know how to and know what you are doing. there different tools to flash custom rom. so look for the best for your phone.