This article explains how to factory reset an Android device. The instructions in this article apply to Android 10 and later, and should work regardless of who made your Android phone (Samsung, Google, Huawei, Xiaomi, etc.).
How to Factory Reset (Hard Reset) an Android Phone (42)
Make sure to back up your Android data before starting the reset process. Starting with Android Marshmallow (version 6.x), your device automatically backs up to Google Drive. You can also download an app like Ultimate Backup to manually back up your device. Follow these steps to factory reset your Android smartphone or tablet.
Open the Settings app on your phone or tablet.
Tap System > Advanced > Reset options.