If the VS code is not taking input make sure that you have code runner installed on your VS code. This can also happen if the software you are using is outdated software, make sure that you are using the latest version of VS Code and your device is up to date. If your device does not have enough RAM, it could lead to freeze.