Unlock the bootloader (fastboot flashing unlock; LineageOS gives a forced-unlock command: fastboot oem ‘setenv lock 10100000;saveenv;save’), patch the stock boot.img with Magisk and flash it. Only works on builds before the August 2024 OTA.
Follow the specialist sources linked on this page. If this path is a jailbreak, unlock, or flash, the specialist wiki is the how-to — we do not copy those steps here.