May I know which device you are using? What's the problem you face while trying to factory data reset? You have two easy methods. 1. Settings>General management >Reset >Factory data reset. 2. After rebooting to the recovery mode. (Steps depends on the phone model) Anyway, before reset, please be sure to, 1) Backup all important datas, 2) Remove all accounts from the phone (esp, Google and Samsung) 3) Write down your account name and passwords.
you have to remove your all account from the mobile from all where and then you have to restore your mobile because if you will not remove your account and you do your mobile reset and after resetting when your mobile will reboot you need to go for the Google bypass and there you need your old email id which is you signed in your mobile and it will not open until u did not put your email ID