I assume you mean the iMac (Retina 4K, 21.5-inch, 2017) which came out in June 2017.
Yur Mac cannot run anything higher than Ventura. For now, Ventura is one of the "most recent three" – but if Apple sticks to the same release schedule that they have for the past ten years, Ventura will fall off of that list some time in September, October, or November.
If your iMac has
- The 1 TB mechanical hard drive, or
- The 1 TB Fusion Drive
that drive is very likely a cause of slowness. The 1 TB hard drive uses a 2.5" 5400 rpm notebook drive mechanism, and the 1 TB Fusion Drive combines that mechanism with a skimpy, inadequate amount of SSD storage.
You could add an external SSD, using a USB-A (USB 3.0), USB-C (USB 3.1 Gen 2), or Thunderbolt 3 connection. A couple of examples of mid-priced SSDs would be:
Making an external SSD your startup disk would help with the time it takes to start up the Mac, and with the time it takes to launch applications, and might make the Mac feel "snappier" in other ways.
But it wouldn't let you do anything to upgrade past Ventura.