The way you described as to download the run file from the Nvidia website and to run that in order to install the Nvidia driver is the way of doing it how it was done back at around 2010. That or using the
smxi script or another script to install the video drivers, those were the two options that were mostly used.
Now days distribution maintainers package the nvidia driver and place that in the default repositories of the distribution.
I wasn't trying to sound like know it all because I don't know everything, I was trying to make clear to OP to not use the method you and
@Alexzee described because it is not the recommended way of doing things now days anymore. Because of having to reinstall the driver by rerunning the run file for each kernel update and having to explain the way around that making things unnecessarily complicated and most likely confuse the OP since they are new to Linux.
You use your package manager to install the Nvidia package, so you don't need to close all your X applications in order to install the driver.
Code:
sudo apt install nvidia-driver-510 nvidia-utils-510
Then afterwards your reboot your system or restart X and the driver is loaded, with kernel updates the driver still works and when a new version of the driver is available is is placed in the distributions repositories by de distribution maintainers. After which you you just run a system update.
The driver will be updated and then you will need to reboot your system or restart X to load the new driver.
The depending on the distribution and the package manager used by the distribution the name will vary but have something Nvidia in the package name. Also I rather keep things simple rather than complicated myself, the KISS principle.