Do you mean your lockscreen passcode? If so, you wil have to restore the phone on the last computer it was synced with. If you do not have access to the last computer it was synced with, you will have to force it into recovery mode & restore as a new device. See http://support.apple.com/kb/HT1212
Hope this helps!
If you cannot remember the passcode, you will need to Restore your device...
Connect to iTunes on the computer you usually Sync with and Restore...
If necessary Place the Device into Recovery mode...