Your Mac may be suffering from a hardware failure. As you did not state anything about your iMac other than the symptom and version of Mac OS installed, what we look for in-addition is:
- Model year of the Mac
- What type of drive is installed, i.e. HD, Fusion Drive, SSD etc....
It will help us get a good idea of what is causing your problem if you provide a report of your system, that way we do not have to play 20 questions with you. The report we are requesting does NOT provide any personal information and is extremely safe to use. Please navigate to www.Etrecheck.com and download the free version of EtreCheck. Once you have you downloaded the app and installed it, please run the report and save it. This report will help us get a good idea what has been installed on your system and help us be able to diagnose what may be wrong.
When you have your report, you can attach it when you reply to this message and we can then review it and help you determine what is needed to get your system running well again.
For instructions on how to download your EtreCheck report and attach it to your reply to this message please click How to use the Add Text Feature When Post… - Apple Community It is helpful to us if you download the report to your Desktop.
Once we know the type of drive installed we can offer further direction. However, if the computer is older than a 2017, you may want to prepare to replace it. Before you do anything at all though please ensure the computer is fully backed up to safeguard your data. If the drive is failing all your data is at risk of being permanently lost without a sound backup plan!