Below are the steps to reset the passcode on an iPhone.

Warning: this will wipe all files, settings, and apps from the iPhone, including the passcode 

  1. Need computer (with iTunes) and USB cable
  2. Make sure iTunes in running on your system
  3. Press and hold the Home and Power button at the same time until the iPhone turns off
  4. Release the Power button, but continue to hold the Home button
  5. Plug the USB cable into the computer & iPhone (while holding the Home button)
  6. Continue to hold the Home button until an alert message in iTunes appears that reads “iTunes has detected an iPhone in recovery mode.  You must restore this iPhone before it can be used with iTunes.” – click OK
  7. In iTunes, under “summary” tab, click the “Restore” button to restore the iPhone