Before you attempt the aforementioned methods, remember that they only allow the device’s owner to reset their iPhone if they’ve forgotten the password. For example, if the Touch ID or Face ID hardware starts malfunctioning and users can’t remember the passcode they originally put in place during the setup process, the only reliable option left is to reset the iPhone and set it up all over again. In order to go ahead with the setup process after performing a reset, the Apple ID credentials are needed. In fact, Apple will only accept iPhone repairs if the phone is unlocked or the person bringing it for repair can access the linked Apple account.
This is a mandatory security process and ensures that even if your phone is lost or stolen, someone can’t simply wipe it and start using it as their own phone. Apple ID is the account that allows users to sign in to all Apple services. If an iPhone user has trouble remembering their Apple ID credentials, they can change the password using a trusted device belonging to a friend or family member. This can be done by using the Apple Support app or the Find My app installed on another iPhone, iPad, or iPod.