A computer that freezes mid-task or restarts without warning is one of the most disruptive faults you can face, because it strikes without a pattern you can plan around. The causes are usually few: overheating, faulty memory, a bad driver or update, a failing storage drive, or an unstable power supply. The trick is to isolate the trigger by changing one thing at a time and watching what changes.
Start by writing down when the problem happens. Freezes during games or video work point toward heat or graphics problems. Freezes shortly after startup point toward a startup program or driver. Random restarts with no warning can point toward power or memory.
Rule Out Heat and Recent Changes
Heat is the easiest cause to check. Make sure vents are clear, the machine sits on a hard surface, and fans are running. If freezes happen after the machine has been working hard for a while, let it cool and see whether the problem takes longer to appear. Also think about what changed just before the trouble started: a new driver, a system update, a new program, or a new piece of hardware. If the problem began right after a change, undo that change first, whether that means rolling back a driver, uninstalling a program, or removing the new hardware.
Run the system with a minimal setup for a while. Disconnect external devices you do not need, close unnecessary programs, and avoid overclocking settings if any are enabled. If the machine becomes stable, reconnect things one at a time until the problem returns.
Test Memory, Storage, and Drivers
Memory faults cause some of the most random-looking freezes and restarts. Use the built-in memory diagnostic tool in your operating system to test the RAM, and if the machine has more than one memory module and you are comfortable opening it, test with one module at a time. Storage problems cause a different pattern: long pauses, programs that stop responding, and errors when opening files.
Drivers deserve their own check. Update the graphics driver and the chipset driver from the manufacturer's site rather than relying only on automatic updates, and remove old driver software for hardware you no longer use. If freezes began after a driver update, roll that driver back and wait for a fixed version.
Know When It Is a Hardware Repair
If freezes continue after you have ruled out heat, memory, storage, and drivers, the fault may be in the power supply, the motherboard, or the graphics hardware. At that point, a repairer with diagnostic tools can test parts by substitution, which is faster and safer than buying replacement parts on guesswork.
Freezes and restarts feel random, but they almost always have a trigger: heat, a recent change, memory, storage, or power. For related troubleshooting, see How to Stop Your Laptop Fan Running Loud and Hot and How to Fix a USB Drive or External Drive That Is Not Recognized.