If you forgot your Passcode, the advice given here is perfect.
If you forgot your iCloud password, there's nothing, and I repeat nothing, that anyone, including Sprint or Apple, can do to recover that password, except here:
They will not provide you with answers to your hint questions. They will not listen to your story and give you your Apple ID.
Here are steps on how to solve forgot iPhone passcode:
Hold the power and home button until the screen goes black. Then release the power button and continue to hold the home button for 10 seconds.The device will remain powered off.
Then connect iPhone to iTunes. iTunes will recognize the iPhone in DFU mode and ask if you would like to restore.
If you mean your lock screen passcode, you will have to restore your device. If the Find My iPhone feature is enabled,you will not be able to reset it without disabling it first, and since you forgot iPhone passcode, there is nothing we or anyone else can do for you. If you're referring to the iCloud activation lock, there is nothing that we or anyone can do for you except tell you to try to remember your passcode.
If you forgot your iPhone passcode you can bypass the lock screen completely and reset the passcode by using iPhone recovery mode.
Now that the iPhone is in recovery mode, you must restore the device:
This will wipe all files, settings, and apps from the iPhone, including the passcode. When the restore is finished, the iPhone will be at the factory settings. At this point you can choose to start from scratch or to restore the iPhone from a backup.
This tip came from an iPhone repair shop, where it’s common for people to bring in a phone for fixing and then forget to provide the passcode.