A computer locking up or freezing if often caused by a software related issue, if you are experiencing the computer freezing up when you are opening a particular program, it could be related to that program it might need updating or re-installing. A computer lock up can also be caused by outdated or corrupted drivers, for example if your computer locks up when playing music it might be a corrupt audio driver causing the issue. It can sometimes be very difficult to pin point the cause of a computer lockup especially if it appears at seemingly random times.

Heat Related Issue
If your computer randomly freezes this could be caused by the CPU or Graphics card getting to hot, heat is the computers worst enemy, if you have heard any abnormal noises coming from your computer it could be an indication of the fan beginning to fail. Another cause of overheating is if the heat sink and fan are blocked up with dust particles ( see image ).

Hardware Issue
A problematic hardware component could also be causing your computer to lockup or freeze and it can be difficult to find the faulty component, the easiest solution is to swap individual components in and out of the system and then test the computer to see if the problem has been resolved.