Make a backup first with twrp and copy in a pc. If you want, you can restore your settings and apps following this post https://xiaomi.eu/community/threads/otg-backup.46227/#post-442629.
You can use this https://en.miui.com/thread-1662482-1-1.html or wipe data and format internal storage, with...