If you forgot iPhone screen passcode, but still remember your Apple ID passcode, you can use iCloud Find My feature to unlock your iPhone. If you do not remember your Apple ID password as well, or there is no Apple account logged in your iPhone, you can use iTunes Recovery mode or MagFone iPhone Unlocker I know to unlock your iPhone. Kindly note that there is the iCloud activation lock on your iPhone after removing iPhone screen passcode if the Find My feature is enabled on your iPhone. MagFone iPhone Unlocker can also help you bypass iCloud activation, but you need to check if your iOS version is supported to bypass iCloud activation lock.
Last words, you'd better to remember the correct password to unlock iPhone, as all of above methods would erase all of your iPhone data.