The password function is useful in preventing your iPhone from getting stolen and keeping privacy--until you forget your password, that is. After several incorrect guesses, the iPhone will automatically disable itself for a short period of time. Plugging it into iTunes has the same problem since it asks you to type your four-digit password into your phone. Fortunately, there is a solution: setting the iPhone back to factory settings.
Turn the iPhone off.
Plug the USB cable into your computer.
Press the "Home" button on the iPhone while you connect the other end of the USB cable to the iPhone.
Press the "Home" button down until the iPhone's screen shows a USB cable and an arrow pointing to the iTunes logo.
Open iTunes. A box will appear, telling you it is in "recovery mode." Click "OK."
Click "Restore and Update." Then click "I Agree" when the license agreement appears. ITunes will then restore your iPhone to its original factory settings.
Things You'll Need
The "Home" button is the round button with a gray square on it below the iPhone's screen.