Sometimes it is possible, when due to something wrong, your iPhone 3G freezes, you need to reset it and you can adopt two techniques to achieve this, namely, soft reset iPhone 3G and hard reset iPhone 3G. Sometimes when you want to give away your iPhone, but definitely dont want to let your personal information too to go away with it. In such circumstances, you must reset iPhone 3G to factory settings.
For doing soft reset, keep pressed Sleep/Wake button located on top of the phone till it shows the red shut down slider, which you will have to drag. Keep the Sleep/Wake pressed till the Apple logo appears. If this doesnt work, you will have to hard reset.
To do hard reset iPhone 3G, keep on pressing the Sleep/Wake and Home buttons for around 10 seconds. While you are doing that, the red slider will show and vanish and the screen may become black. However press and hold the keys. The Apple logo will appear and your phone will be reset.
Now for doing reset iphone 3g to factory settings, make sure that the screen is displaying the Settings icon, which is the image of gears. Touch the icon. Setting menu will be seen, in which you have to select General, which too has a picture containing gears. Go down this General page and you will come to Reset. Pick it out. Various options will show on the screen, such as setting, network settings, location warning, home screen and keyboard dictionary. However since the data is to be erased, you must choose Erase All Content and Settings. After you pick it up, a box will appear with a red button, which says Erase iPhone. A warning will also be visible that all media and data will be wiped out in an hour. Touch this red button and your iPhone will restore itself to factory settings.