I had forgotten the unlock pattern, PIN and other unlocking credentials for a Xiaomi Mi Max 2 phone. I did not care about the data and settings on the phone, I just needed to factory reset this Android smartphone, so that I could create a new Google account on it.
Thankfully, Xiaomi provides a way to hard reset the phone without unlocking it:
Power off the phone.
Keep Volume Up and Power button pressed together, until the Mi logo appears.
You will be led to the recovery menu. Here you can choose to Clear Data, which will effectively factory reset the phone.
Reference: Hard reset Xiaomi Mi Max 2