Before reselling or giving away your device, sign out of your Xiaomi Account and turn off Find device.
For this you will need unlock code or imei.
Official 100% safe
Check