Usually after flashing a new ROM, such as Lineage OS, you may encounter a bootloop.
Important: Backup your data, as it can be lost if something goes wrong. Flashing your device can damage it permanently, so doing so would be at your own risk
To remove the bootloop, ensure to use TWRP.
Boot into TWRP recovery and make sure you have access to the storage via MTP, in case something goes wrong. Ensure that a working ROM is in the root of the data partition, for flashing.
Before installing the ROM, in TWRP, choose Wipe. This will Wipe Data, Cache, and Dalvik (not including the internal storage).
Install your ROM and reboot, this time the bootloop should disappear.