In addition to Kappy's suggestions I suggest checking the following items:
1) A hard drive that is experiencing read/write issues can manifest itself as a slow system (pauses, beach balling). You can quickly check the SMART status of the drive using an app that can read the SMART logs from the drive. One option is Smart Utility from Volitans Software, and another option I learned about today by reading the comments from other users is an app called DriveDX. Demo copies can be downloaded from the respective developer websites.
2) Check for adware. This has been a source of frustration for my parents who are lured into clicking on links that they shouldn't. Tools like Etrecheck and MalwareBytes provide options for evaluating a system for common issues, and then provide options for resolving many of them.
There are lots of other questions that need to be answered in order to provide a more detailed answer including more information about the model of iMac, the amount of memory installed, and which version of Mac OS it is running. If you continue to have issues I suggest upload an Etrecheck report.
One word of advice is to always make sure you have at least one backup. It's a lot easier to recover from an issue when there is a backup available, especially if your livelihood depends on it.