Both hardware and software will cause a system to hang.
For hardware, generally, they cause your blue screen or you just
can boot up to Windows. For blue screen errors, it's usually an
incompatible driver (make sure you select correctly), or is an
updated driver (just do a roll back) that is in conflict. Or in one
of the cases here, the driver wasn't installed properly, and
copying and paste the driver in the system32\drivers folder would
solve the problem.
Software wise, there's lots of reasons. It could be a bug in the
software, using too much system resources, viruses, a very
fragmented drive, too many startup programs and services,
etc.
A lag during surfing - is either Internet speeds or inadequate
system resources. A defragmentation of hard disk, cleaning up of
malwares and adding RAM will generally solve the problems. If it
doesn't, and you are surfing using a tabbed browser, try closing
unused tabs. Too many tabs can take up precious memory
resources.
Hang during boot-up, hints at software problems. Usually, it's the
boot file that is corrupted, and you just need to rebuild
everything and it will be solved. If it gives you a blue screen
immediately Windows is loading up, drivers or hardware are in
conflict. This usually occur in people who have graphics and sounds
on board. Some require them to be disabled manually in order for
external devices to work, otherwise, it will get into trouble.
Drivers that cause problems, boot into Safe Mode to
determine.
Also, it could be too many startup programs and services, which
could be disabled. Sometimes, they can overwhelm a system, even a
brand new one. It's worth to take a look at them and disable
unnecessary programs and services.