There are a few ways to do this, ranging from using Find My Device to unlock your Android to factory resetting your Android. Keep in mind that you will need to know your Google account's email address and password in order to log back into your Android if you factory reset it.