Lock ups are always a difficult situation to resolve. It could be software related, but could also be a hardware or even a driver issue. Sometimes they are caused by software installations/removals which did not properly succeed.
First, try setting up a new user account from Safe Mode and log on using this. This has been known to solve lock ups, but its very difficult to explain why this works in such a small space
By far the easiest way to troubleshoot this, would be to borrow a spare hard disk from somewhere, and try and install a fresh copy of the operating system onto it. The disk must be formatted to ensure it's clean. If the
install succeeds, then it's definitely a software problem which we can look at further.
If it fails, there is a hardware issue. In the event of it failing, try to install with nothing except the keyboard, mouse and monitor connected (no USB, no network, etc). If possible remove all PCI cards apart from the
graphics controller and (if appropriate) remove all but the minimum required RAM. Also disconnect slave devices such as CD's and secondary hard disks [You can copy the operating system CD content to the hard disk which is preferable].
If it will install in this configuration, you can add things back until it starts to lock up again, at which point you will then know which item is at fault.
If in the minimal configuration, the PC still locks up continuously, you could have a faulty RAM, Motherboard, Graphics controller, hard disk, or CPU and in this case, the age of the system dictates the next step.
If you would like further advice on the above, I strongly suggest you post a more detailed system configuration (CPU type, RAM, Operating system, etc). It will then be far easier to assist you.
Hope this is of help. Best of luck...