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:
Reference: Hard reset Xiaomi Mi Max 2