iMac freezes then shuts down, every 1-2 days, after very light use
I have an iMac, purchased in 2016 (Retina 5K, late 2015, 3.3GHz Core i5, 32GB RAM, high sierra 10.13.6) which worked fine until a few months ago when it started freezing for no apparent reason.
If I have the sound volume set, I hear a crack, like a whip cracking as the computer freezes.
Light usage is, for example, when I could be just writing a short email when this problem happens, or when I'm just looking at a webpage, scrolling and clicking or clicking browser tabs. This problem has made this computer virtually unusable.
After this freeze, the computer then shuts down and because I have set it to restart when that happens, the computer boots up again. But because this restart does't load all my software properly, I have to click restart when the login window appears.
I have a USB external hard disk connected to the Mac but nothing else, other than a wireless keyboard & mouse.
Also, when it restarts, it loads an app (spotify) which was not running when the computer crashed and I cannot find how to stop this from happening. Spotify is not set to automatically open when I login under my user name in system prefs.
(P.S. I can't see where I can edit my hardware in my profile here, and as I have 2 27" iMacs, I don't know if I have picked the right one from the list shown by the forum in "What device is this about").