For OS X versions from Lion up to El Capitan.
The simplest way - if available to you - is to use your Purchase History on the App Store.
If you have ever previously installed any OS X version, it will still be available to you from that list. This should include any public beta versions too.
The version available from that list will always be the latest version of its type - i.e. 10.7.5, 10.8.6... 10.11.6
Image heavily modified to show only OS versions.
Note, it will say Download or Install depending on whether or not you have the Installer file saved locally - even on a non-boot drive.
For OS versions since Sierra.
Sierra itself has now vanished from everybody's Purchase History. However, Apple are keeping Sierra fully available, even though High Sierra is out. No Apple ID is required.
If the version you are trying to download is older than the Mac you are attempting to download it to - the Store will not allow the download.
[looking for workarounds to this part - edits welcome]
If you are trying to update an older machine running Snow Leopard or Lion, then you can get a special version of El Capitan from the App Store
This version of El Capitan is for users running OS X Snow Leopard or OS X Lion who would like to upgrade to macOS High Sierra. If you are running Snow Leopard or Lion and would like to upgrade to High Sierra, you need to install El Capitan first. This version of El Capitan can also be installed on computers that are not compatible with High Sierra.
Note that last sentence... this version will not install on any machine that is not currently on Snow Leopard or Lion, if the machine is capable of running High Sierra.
That leaves it as quite a specific resource & not a general 'get out of jail free card' for anyone wanting El Capitan.
If you need to reinstall from Recovery, & were previously running Sierra 10.12.4 or higher, there are now 3 options available.
Hold the appropriate key combo at the boot chimes...
- Cmd ⌘ R
reinstall the latest macOS that was installed on your Mac, without upgrading to a later version - Opt ⌥ Cmd ⌘ R
upgrade to the latest macOS that is compatible with your Mac - Shift ⇧ Opt ⌥ Cmd ⌘ R
reinstall the macOS that came with your Mac, or the version nearest to it that is still available.
The first 2 options are available to any Mac newer than Lion, approximately 2009.
#If none of these methods are available to you, you have two options
Find a friend who can access the download [recommended]
Find a torrent/sharing site [not recommended]
If you need to create a bootable USB to install from
How do I make a bootable USB OS X installer on a Mac?
Note: No version of Time Machine can be used to revert to any OS older than that of the latest backup in the Time Machine drive.
This means that to preserve your ability to ever restore to an earlier time & OS, you must swap out your Time Machine drive just before you upgrade the OS. Once it sees the new OS, there's no going back.
You can pick data out manually, but cannot use it as a restore to the older OS.