If you're talking about your Apple ID/account password, see this support article:--> If you forgot your Apple Account password - Apple Support
If you're talking about the passcode to unlock your iPhone's screen, see these instructions, keeping in mind that if you don't have a backup all data will be lost on that device (except those that you eventually synced to iCloud):
If your device is running iOS 15.2/iPadOS 15.2 or later, AND if you have created a backup to iCloud, you don't need a computer in order to reset the passcode:--> If you see an iPhone or iPad unavailable message or Security Lockout screen
Shouldn't be this case (iOS/iPadOS earlier than 15.2), you need a computer. If you don't have a computer, borrow one from your friends/relatives/neighbors or ask for help at an Apple Store or Authorized Service Provider, then read these suggestions.
Given that to remove the existing passcode you must connect your device via USB to a computer (a Windows PC running the latest iTunes version, or a Mac, which can run iTunes or Finder, depending on the macOS installed on it), pay attention to the specific gestures that you need to perform while connecting your device to the computer.
These are the instructions to re-gain access to your iPhone:
If it is an iPhone:--> If you forgot your iPhone passcode - Apple Support
Regards
Giulio