A lot of these 21.5” and 27” iMac models were purchased with the cheapest big storage available; with hard disk drives (HDDs).
Backups are your priority, as HDD failures can be incremental, and the more the disk is exercised, the less the data you might get back from it, if here is a HDD failure underway. (This doesn’t apply to SSDs, which tend to fail hard.)
Backups are one of the very few ways to mark data as being valuable. Data with no backups and data that can’t easily be re-created or re-generated is not valuable data. Too many folks lose too much precious data to theft/fire/dunking/dropping/failure
The more you describe this, the more it seems a corruption, or a hardware failure. HDD failures can happen incrementally, over time, with increasing effects, too. There are some other potential causes for corruptions, including some types of add-on apps; add-on security apps and add-on cleaner apps, for instance.
Once you get your backup, run Apple Diagnostics.
Use Apple Diagnostics to test your Mac - Apple Support
Next, download and run EtreCheck and share the report to the clipboard. Then open a new reply here, and press the Additional Text button that looks like a printed page. You can then paste the hardware and software configuration report here; into the Additional Text text input box.
Finally, if this is a failing HDD there is a potential option (short of replacement with iMac 24” or other Mac) that can get a few more years, and with better performance:
Why is my hard disk drive iMac so slow? - Apple Community
.