Rooting has become pretty straight forward since Magisk came out. This is one approach to root your device. All you need is a custom recovery and then just flash the Magisk systemless root .zip.
First step would be installing the custom recovery TWRP.
This device uses dm-verity!
This means that swiping to allow system modifications will prevent you from being able to boot if you are using the stock kernel. In order to bypass dm-verity's boot prevention, you will have to install a kernel that has dm-verity disabled in the fstab.
Odin Install Method (No Root Required):
You will need to download and install Odin on your PC.
Once you have Odin installed, download the proper .tar file for your device from the download link above.
Power off your device. Turn on your device using the proper key combo to get into download mode and attach the device to your computer via a USB cable.
Use the PDA tab or button to browse to and select the tar file that you downloaded and flash the device.
Note many devices will replace your custom recovery automatically during first boot. To prevent this, use Google to find the proper key combo to enter recovery. Once TWRP is booted, TWRP will patch the stock ROM to prevent the stock ROM from replacing TWRP. If you don't follow this step, you will have to repeat the install.
Time to root via custom recovery:
`Download the Magisk zip file.
Reboot to a custom recovery and flash the flashable zip
Reboot and check whether Magisk Manager is installed and the version matches the one in the OP
If for some reason Magisk Manager isn't installed/upgraded automatically, please install/upgrade manually!`