Factory reset completely wipes your switch data and returns it back to factory settings. This process is irreversible and should only be done in extenuating circumstances or when you want to remove all user data from the switch.
In order to factory reset you do the following steps:
Press and hold the OFF button your switch for 15 seconds until you see the factory reset UI
Factory reset UI looks like this:
Tap factory reset button. This will then show a confirmation screen where you need to press YES to continue with factory reset.
Confirmation UI looks like this:
Wait for the switch to reboot. DO NOT cut the power the switch while it is resetting. Once the switch is reset it will show the start screen for switch setup.