With Adb ((link)): Install Magisk

adb reboot bootloader fastboot flash boot magisk_patched_*.img fastboot reboot

Before proceeding, ensure you have:

If the device gets stuck in a bootloop (logo stays on forever), you likely flashed the wrong boot image version. You can restore your device by rebooting to fastboot and flashing the original, unpatched stock boot image: fastboot flash boot original_boot.img install magisk with adb