Connect the device to a Mac over USB and restore it using Finder. 

Once the restore process is complete, you can restore the backup or just set up the phone as new. The apps, data, passcode will all be erased.