Troubleshooting an endlessly-rebooting mac
My mac (27" iMac) has been functioning fine for years. It's running Mojave, with the latest software update as of a week ago. (It -- and I -- will never be able to update to Catalina, as Catalina breaks critical software I need to use.)
A few days ago, it spontaneously froze: spinning wheel, unable to move mouse, keyboard shortcut to task manager unresponsive. After an hour sitting like that I hard rebooted. It then shifted to an endless cycle of starting to boot (seeing apple logo and bar graph), then before the bar graph completes, I hear a click, the screen goes black, and then I get a gray screen and a message "your computer restarted because of a problem....". It then restarts and repeats. Endlessly.
I've tried holding shift to launch safe mode but there was no visible effect.
What other troubleshooting steps can I follow?
Thanks!
iMac Line (2012 and Later)