For most users, the Apple Support document just below is the easiest method to use, but it does require the use of a Mac or PC to erase and reset the phone. During the new setup, you can use a recent backup to reload data back on to the phone.
If you forgot your iPhone passcode - Apple Support
If you don't have a Mac or PC, you can try to use the next Apple Support document below, but it is more difficult than the previous document for most users.
If you see an iPhone or iPad unavailable message or Security Lockout screen - Apple Support
Sorry for the lecture, but it might be a good idea to write down the new passcode that you choose and keep it in a safe place......even if you are sure that you will never forget it. This will go a long way toward avoiding future disasters.