That depends on whether or not your device has a Locked Bootloader.
If have the North American Snapdragon variant, then you're out of luck.
If you have the Exynos variant, then you can Unlock the Bootloader & Flash away, AFTER you have Root.
You should be able to update to One UI V3.1.
In Settings > About Phone, what is the model number, ie: SM-A11????
Also in About Phone, what does it say in Status Information, Official or?
You presumably tried getting the update from Settings > Software Update?
If you have a computer with Smart Switch installed, you should also be able to get the update to One UI V3.1 using Smart Switch on your computer.
Lastly what Carrier are you with?
Are you in the US?
That device is an American Galaxy, and I believe that it's locked to AT&T
By "which Carrier", I mean who is your Cell Service Provider.
You can try using an tool called Frija to find the correct Firmware for your device.
Here's the link to it on XDA.
Virtually certain, that there's no chance WHATSOEVER that you can Root it though.
Okay, just as long as you know that it's a US device & unlike Canada, US phones can be "Carrier Locked". AT&T is probably the least forgiving of the US Carriers when it comes to installing another Carrier's Firmware, which may be why you've been having difficulty updating.