My xbox stopped working randomly?

One day while I was play my xbox it started to turn off on it’s own, I ignored it the first few time thinking it might be overheating and I decided to get off. Later when I went to play again when I loaded into a game my xbox just turned off and wouldn’t turn on again. Any time I tried it would make the noise of it turning on but it wouldn’t and would make a weird noise like the fan trying to turn on. I’m thinking something might of overheated and permanently broken it. I wanna know before I buy a new one.

My console happened the same thing about week ago im not sure what happen to it but i got on 5 min later i soon i was loading into a game it crashed completely and it turn off i turn it back on it kept saying 102 error turning on ion how to fix it can you all explain what really happen and if it has solution.