What does Hardware Test show? That will report far from all possible errors, but it’ll find some common ones. (Apple has better diagnostics that they use.)
Hard disk drives work well right up until they don’t. The disk can fail slowly and gradually, and can slow performance as the hardware tries to and successfully recovers from the increasing tide of errors, or hard disks (or SSDs or computers) can fail catastrophically and all at once and just drop offline. (We don’t get the smoke and grinding and loud pinging and metal-on-metal screeching of old-time hard disk drive head crashes, alas. Those could be impressive.)
The I/O load of a volume repair attempt or of a re-install can push the failing hard disk over into full failure, which is why grabbing a backup on a slow system can be a priority over any other related recovery efforts.
Use Disk Utility from Recovery and try to confirm that the internal disk is GUID-partitioned (GPT-partitioned) and that the file system is HFS+ journaled hierarchical file system. If you’ve re-installed, that should be the default as far back as macOS Lion.
But with a ~decade old Mac, a failed HDD is a reasonable bet.
An SSD upgrade is usually an option, and it’ll typically be a big performance boost over a hard disk drive too. OWC has a pretty good reputation around SSD upgrades including for iMac, though there are other vendors. Or a local Apple service provider will usually be willing to swap for a new HDD or new SSD.