A late 2009 iMac can upgrade to macOS High Sierra but no further.
Open Safari and click on the link below, do not use Firefox.
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 Get or Download.
If the App Store says ‘Open’ 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'.
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.