Most CPUs have thermal protection built in; when they get too hot, the computer will shut down without warning. This can happen when the CPU cooler is clogged with dust or the CPU cooling fan is not working. Take the side panel off the computer case, power up the computer and make sure the CPU fan is spinning. If not, your computer is going to shut itself off pretty quickly to prevent the CPU from frying. It's not very common, but sometimes when a computer is banged around, the CPU and/or the CPU cooler can be unseated. Also, if cheap thermal paste between the CPU and CPU cooler is used, it can wear out, causing the CPU to overheat.
If you have memory(RAM) problems, usually you get beeping before the computer boots up. If you have so much dust in your computer that the memory chips are overheating, you need to clean it out way more often.
It could be the power supply as well. Usually, not always, PSU's will start acting up before they go out completely; monitors will go black, programs will crash without warning, things that weren't happening before.
I would encourage everyone to learn enough to fix their own computer. It's not really that hard and kind of fun.
Hope you get your problems straightened out.