Unlock the bootloader
Back up all important data
Install Android platform tools on your computer
Download the correct factory image or firmware for your device
Download a compatible root method such as Magisk
Extract the boot image from the firmware
Patch the boot image with Magisk
Transfer the patched boot image to your computer
Boot the device into fastboot or bootloader mode
Flash the patched boot image with fastboot
Reboot the device
Install the Magisk app
Verify root access with a root checker app
Re-locking the bootloader only if the device and root method support it safely
