To be honest it's been absolutely ages since I updated or flashed a different rom on my mi pad 4. Been running Carbon rom for a long time now without issue. But, I'm pretty sure when you get your mi pad you'll need to update to the latest firmware first. Grabbed a link for you but to be honest I can't recall which firmware I'm running and if the thread still shows latest. You'll have to have a search about for latest if the link is outdated.
https://forum.xda-developers.com/mi-pad-4/how-to/rom-miui-10-xiaomi-eu-links-t3839487
And yeah, pretty sure you'll need to sign in to your mi account at some point when updating, maybe even on the rom it comes with. Sorry dude, I really can't remember now as it's been so long since I flashed a xiaomi.
Here's another thread
https://forum.xda-developers.com/mi-pad-4/how-to/rom-miui-10-xiaomi-eu-links-t3864882
After flashing latest firmware (+ twrp) you'll need to boot into twrp and wipe cache, data and dalvic. Don't wipe vendor as this will wipe the essential firmware that you just flashed and is required as a base for you custom rom (carbon)