Close all your unnecessary tabs which you are not going to use immediately.
Heat related issue: Computer may also freeze if the processor is getting too hot because of the failing fan.
Remove unnecessary programs that you are no longer using, they simply occupy space and memory.
Computer Viruses: Computer freezing could also be a sign of your system being infected by the virus. So, avoid visiting the indecent websites. And make sure your computer has an antivirus software installed.
Windows Task Manager: Press Ctrl + Alt + Del to open the Windows Task Manager and see the highlighted program that is not responding and choose End Task, which should unfreeze the computer.
Reboot: The only simplest alternative then left is to reboot the computer. Press and hold the power button until the computer turns off. You can again start the computer after some time by choosing the Start Windows Normally option.