Computer freezes frequently. How do I diagnose the computer to find out the reason ?

You can start by testing the hard drive with a bootable CD containing diagnostic software. You cannot test the system drive properly with Windows-based diagnostic software, hence the bootable CD. The links here: http://www.tacktech.com/display.cfm?ttid=287

If the hard drive passes the test okay, move on the testing the RAM with Memtest, again this loads from a bootable CD:
http://www.memtest86.com/download.htm