warranty will lose once you root your phone or tab , and unroot won’t be restore your warranty.
1: Go to the settings then choose About Device move down to the “Build number” and tap in it 7 times you will see “developer mode is active”.
2: Open the developer mode then check the USB debugging. ”
3: Go to the Security and check the box on Unknown sources.
4: Install the root checker basic in to your device.
5: Go to the Google chrome then type “Kingroot” Install the King Root app in to device.
6: Open kingroot swipe up and click to “Try it”
8: May be first attempt shows failed , but you can try it again. it should be fine.
9: Check your device rooted , use root checker.
UN-root procedure :
1: Open Kingroot app
2: on the top right side click on 3 dot.
3: General settings
4: Uninstall kingroot
5: after that check the root status with root checker it should be unrooted.
You can follow the steps with both android and windows phones .