You can download the Samsung SM-G316HU stock firmware file using one of the free Samsung firmware update tools.
The reason you want to use a free Samsung firmware upgrade tool is that the Samsung website does not offer the public direct access to their own firmware files. The most direct way you can get the Samsung firmware files is by relying on one of the Samsung firmware update tools to download it from Samsung’s servers for you.
One of the most popular methods for downloading Samsung firmware is with SamFirm Reborn. This tool will download the Samsung firmware directly from Samsung’s servers. Thousands of people on XDA-Developers and GitHub use this tool every day for downloading their Samsung firmware files that are often required to do things like get root access with Magisk.
Frija is also a free Samsung firmware update tool that will download the latest firmware files to your desktop. Frija has a feature that will try to automatically detect what smartphone it is you have and what file you need, which makes it a little more user-friendly than SamFirm Reborn. So, if you think you will struggle with the technical details, try this tool instead. Apart from automatically checking for your device, the features are the same.