For users on macOS High Sierra or earlier:

To download the macOS El Capitan installer, follow these steps:

You can download on any Mac, but to El Capitan, your Mac must be one of these:

Apple provides a direct download for the El Capitan installer as a disk image (.dmg) file. Unlike modern versions, this isn't found in the main Mac App Store search.