First method:
The device must be switched off, so hold the Power button for a short while.
In the next step press and hold together: Volume Up + Home + Power key for a couple of seconds.
You should release held keys when the Samsung Logo appears on the screen.
After that, select from Recovery Mode menu "wipe data / factory reset" using Volume buttons to navigate and Power button to confirm.
Choose "Yes -- delete all user data" to confirm the whole operation.
Then select option "reboot system now".
Well done! The hard reset has just been performed.