Computer crashing constantly! [HELP]

So yeh im not sure whats going on with my PC but its crashing all the time and at different times… it can go on for 5 mins and crash or be on for a few hours and crash…

Doesnt seem to be a hardware problem because everything is running fine apart from this crashing…?

Also sometimes it crashes and restarts itself and othertimes it freezes and the power has to be turned off…

So please any help on this I’ve tried everything i can think of… :crying: