Click on this link to read how to get different versions of macOS - https://support.apple.com/HT211683
- This article also has links to system requirements for each OS version which you should check against your exact computer model. Note some of the model identifier articles are outdated. For any model produced in the last 5 years or so you should use the system requirements links for each OS version instead. This web site also has a reliable presentation of model and OS version compatibility: https://eshop.macsales.com/guides/Mac_OS_X_Compatibility
- Make sure you have more RAM than what is noted as "minimum" for any particular system or your computer may run slowly.
- You may find you need to use Safari to get links for High Sierra and later using the Mac App Store application to open a functioning page.
- Sierra, El Capitan, and Yosemite download as a .pkg. Click on this to have a converted version placed in your Applications folder as an "Install OS..." application. Run the installer and follow the directions.
- Upgrades may take some time (up to an hour or more) to install, with restarts and blank screens.
Back up your data in case something goes wrong --> Back up your Mac with Time Machine - https://support.apple.com/HT201250 or use a cloning tool.
Check if your old apps will still work with with the OS you want to install - https://roaringapps.com/apps This is particularly critical if you are upgrading to Catalina or newer, as older 32 bit apps will no longer work.