Transfer the magisk_patched.img file to your computer.
: Download the "Fastboot ROM" (not Recovery) for your model from sites like Xiaomi Firmware Updater.
(Note: Some devices with A/B partitions might require fastboot flash boot_a or boot_b . Samsung devices require a different tool called Odin and a different file format .tar ).