Yes,
The model and year of your Mac will determine which macOS you can upgrade to,
read the following links.
How to upgrade to macOS Mojave - Apple Support
How to upgrade to macOS High Sierra - Apple Support
How to upgrade to OS X El Capitan - Apple Support
Before upgrading make a full back up of your Mac.
Check that third party apps you use have updates available for the new OS.
https://roaringapps.com
Check that your printers/ scanners etc have updated drivers and software available for the new OS.
Connect your mac to your router rather than rely on WiFi,
do not use your mac while it is downloading
and do not use any other devices that share the same internet connection.