Your 2011 iMac can upgrade to both El Capitan and Sierra, it can also upgrade to High Sierra.
Please open your Safari browser and click on these links.
How to upgrade to OS X El Capitan – Apple Support
How to upgrade to macOS Sierra - Apple Support
In each case go to Section 4 and click on Get OS X El Capitan or Get macOS Sierra,
this will install either InstallMacOSX.dmg or InstallOS.dmg to your Downloads folder.
Please read the following instructions care fully as these will tell you how to convert
the .dmg file in to the installer app required to install your chosen OS.
The following text discusses El Capitan but the same procedure can be applied to Sierra, so for
every mention of El Capitan you can replace it with macOS Sierra.
The next section can only be done on a mac that is capable of running El Capitan,
a mac that came preinstalled with an OS later than El Capitan will refuse to do the next bit.
When downloaded open to InstallMacOSX.pkg, double-click on
that and an installation window will open, this does not install El Capitan
but converts the InstallMacOSX.pkg to the Install OS X El Capitan.app which
you will find in your Applications folder, it should be 6.2GBs in size.
(If the installation window asks which disk you want to install to, you must pick
the disk that you are booted to at the time. Not any internal or external disk that
you want to eventually install El Capitan on, that is for later.)
To start the installation of El Capitan double click on the Install OS X El Capitan.app.
The copy of the install app self deletes after installing El Capitan, so make sure you keep a copy of the InstallMacOSX.dmg
if you need it in future, or you could just make a copy of the Install OS X El Capitan.app prior to installing and moving it to
an external drive for safe keeping. It is also possible to create a bootable USB installer disk using the Install OS X El Capitan.app
in the Applications folder and the createinstallmedia command in the Terminal app.
There is a problem with making a bootable USB installer for Sierra, but I can give you instructions on how to get round that.
Read the instructions here,
How to create a bootable installer for macOS – Apple Support
If you want to upgrade to High Sierra you will need to upgrade to El Capitan or Sierra first.
Then open Safari, do not use Firefox it will not work,
How to upgrade to macOS High Sierra - Apple Support
go to Section 4 and click on Get macOS High Sierra, this will redirect you to the App Store
High Sierra download page, it should say either Get or Download.
This will download Install macOS High Sierra.app directly to your Applications folder,
you can make a bootable USB using the instructions above.
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 via cable 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 the App Store says ‘Open’ or 'Installed' then it is detecting a previous download of the install app
go to the Applications folder locate Install macOS High Sierra.app.
Move it to the Trash, empty the Trash.
Restart, click on the link again, the App Store should say ‘Get' or 'Download'.