Macbook pro with intel processor keeps crashing
I have The MacBook Pro "Core i5" 2.6 13-Inch (Mid-2014 Retina Display) with a 22 nm "Haswell" 2.6 GHz Intel "Core i5" processor (4278U), it is monterey and a few months ago it completely refused to start or charge and was instead dead. I recently decided to start it up and it ended up working again, but it keeps crashing whenever I used it, I decided to completely clear our my files, cache and applications through recovery mode but it is still crashing after this. im currently trying to update it to monterey 12.6 in safe mode since it kept restarting earlier while doing this. Is the cause of it crashing cause of it not being updated or is there other issues? (I also tried to boot up apple diagnostics test but it refused to open and instead gave me an error about my network connection.) Ive had this issue before but is there any way to completely stop it from crashing and make it work faster?
MacBook Pro 13″, macOS 12.7