Mi Mix 4
Get twrp image from https://xiaomi.eu/community/threads/howto-install-recovery-image.66211/ (skkk) - you will need to change the language afterwards from Chinese :)
Do NOT get it from https://twrp.me/xiaomi/xiaomimimix4.html as it can't decrypt the data directory or connect the USB.
rename it (after unzipping) to twrp.img
In a command prompt cd wherever the image is on the pc and reboot the phone in fastboot mode (power off, then power on + volume down button - should be an orange fastboot text)
then type:
fastboot boot twrp.img
now you can copy the eu rom and twrp.img. Then flash the image and afterwards use the advanced tab to Install Recovery Ramdisk with twrp.img. After this you need to wipe -> format data or you get stuck in a bootloop.
DONT FLASH THE TWRP! - it's an A/B device, so you have to use the "install recovery ramdisk" option
If all goes wrong, download stock from https://flashxiaomi.com/download-install-miui-rom-for-xiaomi-mix-4-all-miui-firmwares/
Get magisk from https://github.com/topjohnwu/Magisk
Rename the .apk to .zip and copy this to the phone storage, then install with TWRP using the Install button. Reboot and use rootchecker to see if you are rooted.
Open the magisk app and go to settings (top right). Enable zygisk and enforce denylist. Under configure denylist you can put things like banking apps that don't like rooted phones.