Software incompatibility is one cause. That includes having two virus programs on your computer.
Other computer freezes may have other causes such as overheating of the CPU because the CPU fan is failing, power supply problems, failing hard drives, and operating system problems.
In Windows, there is the Event Viewer. That is where you can find system errors. You can try copying the text in the errors and search them on the web for possible solutions. A few of the events listed may even tell you how to fix them.
It also depends on what you are using when you experience lockups. If it is in the browser, you may need to reinstall the browser, or you may need to reinstall JAVA or Flash. In rare cases, you may need to find a JAVA or Flash remover before reinstalling those components.