M4 Mac mini keeps freezing and restarting, even in safe mode
As I write this, my M4 Mac mini is in safe mode and it keeps freezing every few minutes for around 30s to a minute. I couldn't even type the first sentence without the Mac freezing. The Mac mini also restarted by itself while in safe mode. It has just frozen again while I was writing the second sentence. I have apple insurance but what was the point of it? I can't work properly because of this. I have spoken to apple support several times but nothing gets better; every time the conversation ends with words to the effect: "if the problems persist get back to us".
ps The OS(26.5.1 (25F80)) is up to date and in fact I reinstalled it; but when the Mac didn't improve I put it into safe mode.
pps The Mac mini froze during every sentence I wrote in this question.