Don't forget to read the supported models before starting below.
The following protections must be disabled (FRP - OEM) Follow the following article to How to Disbled FRP and OEM for device Samsung Galaxy (Note, there are devices that do not have protections, including old devices).
When you boot into download mode, there is a protection called KG STATE. If the protection is Checking, ignore the next step. If it is Prenormal, follow the next step.
Boot the device into recovery mode, then Wipe Data/Factory Reset, everything on the device will be erased, then Reboot system now, It will take about 10 minutes to boot the device. Here is the most important step when you start setting up the device. Add a Google account and then continue to complete the setup
Now when you boot into download mode it should be FRP:OFF- OEM:OFF-KG STATE:Checking.
This step is very important. Please focus now. We need to download a firmware compatible with the device model and version of the device. It is preferable to download the same version on the device to avoid problems. You can find out the baseband version on the phone or tablet by booting to recovery mode, An example of that.
From where we download the firmware, of course, from our website, by searching for your device model, and it will appear to you. If the same version of your device is not found, you can contact us to provide it to you.
After downloading the firmware we extract the files it will show several files inside the extracted folder BL-AP-CP-CSC-HOME CSC.
All work on the AP file, since the file suffix is .tar.md5, we will remove the .md5 suffix from the file name to become the suffix .tar
Open the Odin tool and from the AP box select the magisk_patched file and press start.
The device will start flashing, it will take about 10 minutes when the flashing is finished, boot the device into recovery mode and wipe data again.
When you start setting up the device, add a Google account and then complete the setup. This step is very important.
Install Magisk manger again and open it.
In newer devices, you need to turn off the device and then Power + Volume Up to get root permissions. As for older devices, you will get root once you open the magisk manger application.
A clearer example: (Powering up normally) > (System with no Magisk), (Power + Volume Up) > (System with Magisk).