Iphone third generation I have and iphone three and I forgot the password on it and it didn't work when i went to restore it. I really need to get back on it again.
It can happen one forgets the password.

Apple knows that and has made every effort to help you with recovering it.

The quickest way is to go to Apple website and request password reset.

It is a Automated process, and you will receive a email from Apple, so look for it.

There is more help here https://support.apple.com/en-us/HT201487