Backup all of your data and settings before starting as you will need to reset to factory defaults during this process.
With that being said, the process is relatively straightforward and easy.
PS: my device is the A908B, there is also an A908N if anyone wants to test on that be my guest.
Step 1 - Downloading your firmware.
Go to SamMobile SM-A908B
Find the correct firmware for your device according to country and operator.
Note: You can use generic country firmware instead, this will remove carrier added software and limitations but may remove features and disables OTA updates.
Note the 'product code'.
Now open SamFirm.
Type SM-A908B for model
In the region box type the product code you noted earlier.
Click Check Updates.
When it has found the firmware, make sure decrypt automatically is checked and then click download rom.
The firmware is around 4gb.
Part 2 - Unlocking the Bootloader
Go to settings > about phone > software information. Hit build number a bunch of times until you activate developer options.
Go back to settings > developer options
Enable OEM unlocking
Enable USB debugging
Turn off the phone
Hold volume up and volume down whilst inserting the USB cable
This should take you to the bootloader unlock screen.
Long press Volume up to unlock the bootloader.
Part 3 - Obtaining root
After SamFirm finished downloading the rom it should have extracted it into 5 tar files.
Copy the tar file beginning with AP to your device.
Download Magisk Manager on the device and install.
Press Install on Magisk Manager
Confirm the Install
Select the option 'select and patch file', then locate the APdjkfgrsdkfhgkjrg.tar.md5 on your device and select it.
Magisk will then patch the file and dump the patched version to your phone.
Copy the patched.tar to your PC
Reboot phone into download mode
For BL use the BL.tar.md5 file from stock firmware
For AP use the patched.tar file
For CP use the CP.tar.md5 file from stock firmware
For CSC use the CSC.tar.md5 file from stock firmware (not the CSC_HOME)
Press Start and wait for it to flash
After flashing, the phone will reset.
After initial setup, install magisk manager again.
Remove the USB cable and turn off the phone.
Turn on the phone by holding volume up and power, let go when you see the bootloader warning.
Open Magisk Manager Click Install.
Phone is now rooted.
Note: Powering on the device normally will disable root, you must hold volume up to power on the device to activate root.