When Emacs hangs or freezes, usually it means that Emacs is stuck in a loop, and you should press C-g to get out. If C-g doesn’t do anything and your Emacs is still frozen, it is likely that you ran a command that synchronously called an external program which for some reason is not finishing its job. In that case, you can get out of the freeze by simply killing that external process. On MS Windows, you can do that from Task Manager. What if you don’t know which external process to kill? In that case, it’s time for the last resort: kill Emacs. By killing the Emacs process, would your unsaved work be gone? Not necessarily. We’ll come to that later.

On MS Windows, Emacs may hang when you try to use commands that rely on external tools like grep, find, ftp, diff, or latex if you have not done the job of installing related tools and configuring relevant user options.