PassCODE or passWORD?
Read the Apple Support document about what to do "If you forgot the passcode on your iPhone, or your iPhone is disabled". Click here then select your device type if necessary --> http://support.apple.com/HT204306 - Also has links for what to do for an iPad or an iPod touch.
Click on this link to read what to do "If you forgot your Apple ID password" - https://support.apple.com/HT201487
or go directly to this link --> http://iforgot.apple.com/
Also read about "What to do after [or before] you change your Apple ID email address or password" - https://support.apple.com/HT204071
If you still need help:
Contact Apple for help with Apple ID account security "This article provides country-specific Apple Support contact information for customers seeking help with their Apple ID password or other security-related issues." - https://support.apple.com/HT204169
Once your get your password the activation lock solution will become obvious but since others may post this anyway I'll provide it (first) here:
"Activation Lock for iPhone, iPad, and iPod touch" is a security feature, in part to deter re-selling of stolen devices. To learn more click here --> http://support.apple.com/HT201365
An activation lock can only be removed using the log-in information for the account that applied the lock. If you know this information click on the link to read how to "Turn off Activation Lock." --> https://support.apple.com/HT201441
If you do not know the Apple ID and password and you are not the original owner, get the owner of the account to remove the lock or return the device for a refund. The device is otherwise useless to you. If the owner has not provided contact information as a message showing in the login screen there is no way to contact the owner unless the person who gave you the device knows them.
If you are the original owner and have forgotten the log-in information, try to recover it:
- "If you forgot your Apple ID" [this is likely an email address you are using or used in the past] click here --> https://support.apple.com/HT201354
- "If you forgot your Apple ID password" click here --> https://support.apple.com/HT201487
Otherwise:
Apple may possibly remove a lock if a person can provide sufficient evidence of valid ownership. The device is normally taken to an Apple Store with identification and the original sales receipt. I.e., the receipt when the item was sold to the first owner, and preferably by that person. This is unofficial and there is apparently no set policy (I asked at an Apple Store). A store may simply refuse, particularly if they are not satisfied you have proven ownership by provenance.