Solution 1. Run System File Checker and Fix the Freezing Computer
1. Right-click the Start button and select “Command Prompt (Admin)”.
2. Type "sfc /scannow" into the Command Prompt window and press Enter to run a full system scan.
Leave the Command Prompt to run – this may take between 5-10 minutes. After the process is finished at 100%, if everything goes well, you would get the message 'Windows Resource Protection did not find any integrity violations.' If you see a message 'Windows Resource Protection found corrupt files and successfully repaired them', it tells you that you have successfully repaired missing or corrupted system files in Windows 10 with SFC.
Solution 2. Updating all Device Drivers to the Newest
According to users, random computer freezing while playing games usually appears after Windows 10 update. And the reason might be incompatibility of hardware and drivers. To correct it, just update all device drivers.
1) Click Start menu and click Settings tab.
2) Click Update & security.
3) Select Windows Update in the left pane and click Check for updates (make sure you have an active Internet connection).
If updating doesn't work try installing the latest drivers for your GPU from the manufacturer's website.
Solution 3. Perform a System Restore or a Clean Install of Windows 10
If your computer still freezes frequently and randomly when you are playing games or doing something else on Windows 10, you may try to either perform a system restore to roll back to the previous version or do a clean install of Windows 10 to find a fix.