Computers get hot. Everything inside a computer generates heat, and heat can cause component instablility (RAM, CPU and etc.) and crash your PC.
If the computer case is too hot, check if all your fans are spinning properly (you know by listening closely: do they make a sound?). Make sure that all of your computer's vents, grates and filters are unhindered by dust, pet hair, and other materials that prevent proper airflow. If you find any problematic areas, use a can of compressed air to clear the airways.
If you use a laptop, make sure to place it on a hard, flat surface that won't "smother" the chassis around its vents, thus restricting airflow.
Note: Be very careful while you are cleaning your computer because it is possible that you detach something (usually the SATA cables in desktop-computer cases are prone to detatching). Double-check everything before you turn your computer back on.