Go to the Settings icon on the home page and select the General option. At the very bottom of this screen there is the Reset button, and if you press it there will be a menu to give you a variety of different reset options. These options go through three different sections.
The top one has two options, which are Reset All Settings or Erase All Content and Settings. The first will just bring all of your iPhone settings back to default, and the second will do that plus remove everything from the iPod section of your iPhone as well as all of your iPhone applications and games.
The second section is more specific than the first and has an option to reset the network settings.
The final segment is even more specific with options to just reset the keyboard settings, the way the home screen is set up, and some warning messages. After you select the appropriate option, you will be asked to verify your choice so you do not accidentally make a mistake.