As you are getting the message to connect to iTunes it appears that you actually mean passcode - a four or six digit number used to lock an individual device - rather than the password which would be to your Apple ID (and thus affect other devices and possibly iCloud and here).
The passcode is stored only on the device, and so cannot be retrieved: Support cannot help you despite the previous poster's suggestion (and your SIM card is not relevant). I'm afraid you will have to erase the phone: hopefully you made a backup and can restore from that.
If you forgot your iPhone passcode - Apple Support
(In the unlikely event you actually do mean an Apple ID password, go to https://iforgotapple.com to reset it.)