The model and year of your Mac will determine which macOS you can upgrade to,
please use Safari to access the following links, See Section 1 for mac compatibility,
How to upgrade to macOS Catalina – Apple Support
How to upgrade to macOS Mojave - 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.
If you are considering upgrading to Catalina be warned that it does not support 32bit apps.
Your Mac is probably running 32bit apps and these will need to be updated to 64bit apps,
some updates may be free, some may be paid. Use this app to discover which apps you have
are 32bit, https://www.stclairsoft.com/Go64/. Once the list has been created you can then
contact the developers of the apps to see if they provide 64bit updates.