Apple differentiates “updates” which are patches and minor changes and expected to be compatible for apps, and “upgrades” which are more substantial changes and may or will require further updates for some of the apps you’re using.
Most any Mac running Yosemite can be upgraded to El Capitan.
If you’re not getting that offered, you may be short on available free storage, or some other detail. See the link for specific requirements, but most any Mac running Yosemite can be upgraded. There are usually some details on the failure included. It’s also possible that an add-on package such as add-on security or an “cleaner” is somehow blocking the upgrade. That add-on security stuff can sometimes be flaky, insecure, or entirely problematic.
Depending on the specific model and year, this Mac might be (directly) upgradable to High Sierra, or Mojave, or maybe Catalina. Those links each include supported Macs, and other requirements, and a download link.
To upgrade, get an external and complete backup, get another backup, check your key apps, check for 32-but apps you’ll need to upgrade or replace (only) if you’re going to upgrade to Catalina, check that your printer and scanner vendors have drivers available for your upgrade, and download and install the upgrade.
Catalina supports only 64-bit apps and interfaces. Earlier macOS releases support both older 32-bit and interfaces, and newer 64-bit apps.