You can do it in settings but I have a feeling you can't unlock the phone.
If you can't unlock the phone, do a forced shutdown by holding power and volume down for around 10 seconds. Then hold power and volume up, release when the samsung logo appears. You are now in the recovery menu. Select the reset/wipe device option.
Big warning, if the device has a google account linked to it, you must set the phone up with that same google account after you reset it. Prevents someone stealing a phone, resetting it then using it again.
Going back a little, if you couldn't get into the recovery menu, you might have a newer device. In this case, plug the phone into a pc (with the pc on), then do the volume up power button thing. Newer phones need to be connected to something as an extra precaution.
It's the same on every samsung phone so you can just google "how to shut down xx phone" and "how to enter recovery mode on xx" phone if you wanted a youtube video or better guide. Me remembering is probably not going to beat a guide online lol