How to turn off 3G on iPhone 4?

How do I turn off 3G on iPhone 4 I want to use Wi-Fi and don't want to risk losing connection From Wi-Fi and then being automatically put on to 3G so it starts taking it off my credit

There's a setting called "cellular data" in your phone.
Turn this setting 'Off'.
The phone will then not be able to search the outside carrier-network for data, and you will not be charged.

Go to Settings, General, Cellular, then turn off Cellular Data.

Settings > General > Cellular > Enable 3G > switch to off.