An IPSW or iPhone software file is a firmware update for the iPhone. These files are typically never seen by the end user as Apple delivers them automatically to the iPhone using iTunes. Modifying the IPSW files has become commonplace as a way of jailbreaking an iPhone, although Apple warns against it and the process may void your product warranty. Jailbreaking is simply the process of installing custom firmware and third-party application store applications to the iPhone. The process of restoring custom firmware to your iPhone is slightly different than that of a normal restoration.
Back up your crucial iPhone data.
Open iTunes. Connect your iPhone to your computer using the iPhone USB cable.
Hold the "Home" and "Sleep" buttons down simultaneously for 10 seconds.
Release the "Sleep" button immediately after 10 seconds are up. Continue to hold down the "Home" button. If done successfully, iTunes will display a dialog window informing you that it has detected an iPhone in recovery mode. Click "OK" and you are taken to the iPhone restore page. The timing is tricky and it may take a few tries.
Hold down "Control" (or "Option" on a Mac) and click "Restore." This will bring up a file browser. Locate the custom IPSW firmware and click "Open." iTunes will begin restoring the iPhone using the custom firmware. A progress bar will indicate how far along the process is and a progress bar will also display on the iPhone. A confirmation dialog will inform you of the successful restore.
Jailbreaking your device, while legal, may void your iPhone's warranty. The process of restoring custom firmware to your device does not always go smoothly, depending on the device (iPhone, 3G, 3GS, 4) and the firmware (2.0-4.0+). It is also extremely important to back up your data before you install custom firmware. It is also important to read up extensively on the jailbreaking process before going ahead. If you install custom firmware, do not update your device directly through iTunes when new firmware is released, as this has the potential to "brick" your device (or make it non-functional) your device.