The 21.5" and 27" Late 2013 iMacs originally shipped with Mac OS X 10.8.4 (Mountain Lion). You can upgrade them to macOS 10.15.7 (Catalina) – but no further.
Quite possibly, the person from whom you bought the Mac was running something later, but wiped the machine and reloaded the original OS as part of preparations for resale. Unfortunately, as you have discovered, Mountain Lion is too old to be able to handle https security on most modern Web sites. The original protocol used for https security was found to be less secure than thought, and there was a move to upgrade Web sites and browsers everywhere.
I'm going to assume that the person who sold you the Mac did this:
What to do before you sell, give away, trade in, or recycle your Mac - Apple Support
To get it something useful, you may need the help of a modern Mac or PC, and this Support article:
How to download and install macOS - Apple Support
Procedure
- Using a modern computer, download the disk image for macOS Sierra 10.12 onto a USB flash drive (or other USB drive). This will not produce a bootable installer, just a drive with a data file (a .DMG file). (The idea, here, is that the old Mac probably won't be able to handle the https security on the Apple Support article, and the http link to the Sierra .DMG file has a long name that is hard to type. So it's easier to grab the file using a modern machine.)
- Transfer the USB drive to the old Mac, copy the .DMG file onto the old Mac, then eject and detach the USB drive.
- Open (mount) the .DMG (disk image) file on the old Mac and use the Sierra installer that you will find inside.
- Once the old Mac has been successfully upgraded to Sierra, its copies of Sierra and the App Store will hopefully work a little better.
- On the old Mac itself, use the Support article and the High Sierra App Store link to upgrade to High Sierra. (This might be necessary because High Sierra introduced the APFS filesystem, and if that machine happens to have a SSD, the installer might want to convert the internal drive from HFS+ format to APFS format.)
- On the old Mac itself, use the Support article and the Catalina App Store link to upgrade to Catalina.
Catalina is not one of the "most recent three" supported by companies such as Adobe and Microsoft. It fell off that list a bit over three years ago, when Ventura came out.
Most third-party Web browsers no longer support Catalina, and the free GNU Image Manipulation Program (GIMP) photo editor has also moved on.
Catalina is still enough to run current versions of
- The Firefox Web browser
- The LibreOffice office suite
- The GraphicConverter photo editor. This one costs money.
- The Affinity Studio application that appears to have replaced Affinity (Photo V2, Designer V2, Publisher V2). This one is free (with registration) unless you want to unlock AI features; then there are subscription fees.