To restore Samsung to factory settings, go to Settings, search for Factory data reset, tap Factory Data Reset, and then enter your Samsung account and password to confirm.