Unity frezes tying to open visual studio

I’m using Unity 2019.2.16f1 and Visual Studio 2019. Everything was working fine, but today it simply stopped. When I try to open a script by double-clicking it on Unity, unity freezes and Visual Studio is never opened. I have to force close Unity after that. If I manually open Visual Studio on the unity project do, then everything works fine. Does anyone know how to solve this?

Go to Edit > Preferences > External Tools > External Script Editor and select your preferred editor. You can also browse it manually to see if it works again.

Never mind. Started working again today. If anyone has this problem, try to restart the PC to see if it helps.