Unlock developers options by tapping 5 times on build name/id or whichever build info you'll fine in Settings/Software information.
Then go to developers options which should be at the buttom
Enable USB Debbuging - that's to do a backup via adb,
Also enable OEM Unlock.
Do a backupa. I've done it via ADB using these two commands:
1. adb usb and then
2. adb backup -apk -shared -all -f backup.ab
Download the newest firmware for your device via eg Samfirm
Unpack it, from within unpack AP package
Inside extracted AP is boot.img file which you'll need to compress into .lz4 archive and name it boot.img.lz4
Patch boot.img.lz4 using magisk app.
Copy patched magisk-patched- boot.img.lz4 onto your PC
After that shut down the phone (just regular shutdown)
Install and start Odin on your PC.
While Odin is running phone is turned off, press and hold Volume Up + Volume Down, and while holding them connect USB cable, Phone should go into Download mode
It will then ask about bootloader unlock which needs to be done, in my case I was asked to hold Volume Up for 7 sec I think
After that my phone rebooted, so Shutdown again, Volume Up + Volume Down - then USB cable connection, device will show same options, that's fine, this time go to download mode aka. odin mode in my case by pressing Volume Down once.
Now go back to Odin on PC.
Click on AP and select magisk patched boot lz4 archve.
Make sure there is only Autoreboot and Reset time selected in options, nothing else
Like here