I hope you mean factory reset. You can do this if you have signed to samsung account. Samsung phone have two step verification process thus data can't be erased without permission
You can perform hard reset method but you may lost all your mobile data.
Check the below link to unlock your Samsung mobile.