Successfully installed TWRP and Magisk means bootloader unlocked?
Install Google's ADB drivers, connect your phone to your PC, open a command prompt and type:

adb reboot bootloader


Then:

fastboot oem device-info


And you will see the bootloader's status, either in the command prompt or on the device's screen.

To unlock a locked bootloader, type:

fastboot oem unlock


Remember that unlocking the bootloader will wipe all of your user data, as a factory reset does. Backup your data first.



Since you have a Samsung phone, remember that Fastboot isn't supported, while Odin is. To unlock the bootloader, simply find the OEM unlock entry in the device's settings and enable it.