(please read the bottom of the post if you have find my iphone enabled- try that method first)
If you´ve forgotten the passcode that you use to unlock your phone daily (like 1234 passcode) : Then do a DFU restore like this :
1.plug your iPhone into PC
2. depending on if your iphone is turned on or off:
a) if you have your iphone plugged in and is turned off the way to get it to dfu mode is to :
HOLD POWER BUTTON for 3 seconds, after 3 seconds COMBINE IT WITH HOLDING THE HOME BUTTON AT THE SAME TIME, after 10 seconds (exactly) of holding them together KEEP HOLIND HOME BUTTON ONLY (about 5-15seconds, till your pc detects it as dfu device-in windows once you hear the beep sound-you can release)
b) if your phone is NOT OFF(is on) :
HOLD POWERBUTTON AND HOME BUTTON TOGETHER FOR 10 seconds
then release power button and keep HOLDING ONLY HOME button until your PC detects it in DFU mode.
3. start iTunes or download it if you don´t have it
4. download the software for your device
http://ipswdownloader.com/
for your iphone 4s its here
http://appldnld.apple.com/iOS7.1/031-4816.20140627.XQbdQ/iPhone4,1_7.1.2_11D257_Restore.ipsw
5. if you are on windows , go to itunes and CLICK ON RESTORE WHILE HOLDING THE (left) SHIFT KEY AND SELECT YOUR DOWNLOADED FILE, YOUR IPHONE WILL CERTAINLY BEGIN TO RESTORE TO ORIGINAL SETTINGS WITH NO PASSCODE
Mac: Alt/Option+Click on Restore
6. Your iPhone should now be restored to factory settings.
7. IF IT NOW ASKS YOU FOR APPLE ID PASSWORD(which you might have forgotten and lost access to your email adress) : You Have to contact your email provider(google, by calling their number and asking for additional information, but yahoo is better with their support, as you can´t contact google support via email, i didn´t manage to do it even via phone and it drained my credit lol) and if requested scan your ID or passport to verify your identity of your account and therefore get acess to it. Try looking into your saved passwords in your browser to see if there is any stored password, you might even try running Recuva software(i´m not advertising -or any other software that scans your pc for deleted files and find the password files for your browser- try searching on google on what the password file is named for each browser) - this might be a lenghty process
You can try reseting your apple id password if you still have acess to your email (or even if not) here:
https://iforgot.apple.com/password/verify/appleid
Or contacting Apple support via email(search for it) as this is probably the better option as they can help more easily.
>>>>>>>>>>>>>>>>>>>
Additionally you might try going into
www.icloud.com and into Find My iPhone and try setting your iPhone to lost mode or setting the passcode that way (if you have FindMyiPhone enabled of course) and then back into normal mode again after you put in new pass
<<<<<<<<<<<<<<<<<<<