For rooting your Galaxy Note 8, you can refer to my original root guide here:
Now, that root method works well but it still keeps your data encrypted after rooting, which means you won’t be able to flash new files(e.g. update Magisk with new version) in TWRP as it will be still encrypted.
The fix is to flash DM Verity No Encrypt zip file in Step 14-15 then flash no-verity-opt-encrypt-6.0.zip and everything else is same. You can flash it before or after Samsung Anti-removal tool. And make sure reboot recovery, and you should see that there is no option for “Read Only” which means your phone has been decrypted and you should be able to flash new files in TWRP after rooting.