If you have your current password, go to your iPhone's settings, tap 'Passcode', tap 'Change Passcode', and enter your current combination, then your new one. If you have forgotten the passcode, you have to restore your device and possibly lose all your data.
The simplest way to restore your phone requires that you had previously synced your iPhone with a computer. Plug your iPhone into the computer and wait for the automatic sync and backup to complete. If it does not start by itself, right click on your device and select 'sync'. The iTunes Status display, a blue bar on the top right corner, displays the current progress of the procedure. When it finishes, click 'Restore your iPhone', and when it finishes, select the backup you just made. When the process is complete, your phone should be unlocked and all data intact.
In case you haven't synced your iPhone with a computer, the only way to regain access to your iPhone requires all data to be deleted. Turn off your phone and plug in the device's USB cable on your computer. The iPhone should not be attached to the other end of the cable. Then, connect the device while holding the 'Home' button. This sets the device to 'Recovery Mode'. iTunes should display a message prompting you to Restore your device. Click 'Restore iPhone', then 'OK'. Select the 'Summary' tab and click 'Restore'. This should reset your iPhone back to default factory settings, allowing you to access it again.