This is a massive issue no one has mentioned:
Hardware Information:
iMac (21.5-inch, 2017)
Status: Supported
iMac Model: iMac18,1
2.3 GHz Dual-Core Intel Core i5 (i5-7360U) CPU: 2-core
You have the crippled educational/institutional model iMac, created to appeal to bulk buyers with limited computing power needs.
It has a slow laptop-class 2-core processor. The standard consumer model that year, the iMac 21.4-inch 4k, had a proper desktop class 4-core processor whose minimum 3.0ghz version was 50% faster than yours for only an 18% increase is purchase cost.
⚠️ Spend NO money except for an external USB3 SSD boot volume. RAM will not help a failing hard drive, and the CPU is not upgradeable.
Add the fact that the computer was not designed to be opened by the end user means you need professional help to add RAM or replace the internal drive. Figure two hours labor at US$65-80/hour from NW US providers I have polled. That, and the required reseal kit, are in addition to the cost of components. And you will still have an under-performing laptop-class processor. Not worth it.
Due the difficulty and high chance of damage to that model, some Apple Authorized Service Providers won't even work on sealed-case iMacs like yours.
I see one "cleaning" app that you do not need:
User Login Items:
[Not Loaded] TCLoginItemHelper (App Store - installed 2023-09-08)
Modern Login Item
/Applications/CleanerOne.app/Contents/Library/LoginItems/TCLoginItemHelper.app
Sometimes removing so-called cleaning apps (110% useless on any any Mac made after OS 10 was introduced in ~2000) may improve drive scores, but your drive cannot do faster than about 80MB/sec when healthy and on a good day. 80MB/sec is still miserable slow with modelr macOS versions.
The external boot volume will improve felt performance remarkably, and you can still use the external for extra storage for your next computer.