Factory reset via Settings (recommended if phone boots):
Before you begin, remember that a hard reset on your phone, including photos, contacts, and apps.
Many users searching for a actually want to bypass Google FRP (Factory Reset Protection). After a hard reset (from recovery mode), the phone will ask for the last Google account that was synced. If you forgot that password, you’re locked.