I am using Unity 2021.3.29 and Visual Studio Code 1.81.1. I tried setting Visual Studio Code as the Unity C# editor by following the guide https://code.visualstudio.com/docs/other/unity. This is also what people on YouTube seems to be doing.
The problem I am facing is that when I first open a script through Unity it opens Visual Studio Code and it seems to recognize Unity code (as I am used of seeing it in e.g. Visual Studio 2019) but then 4-5 seconds later it seems to lose some connection. Please see before and after images below. I am getting no errors in console or anywhere, it just doesn't seem to recognize Unity things like InputField anymore and similar.
Last image is the Extensions I have active for the project if that helps.
How can I fix Visual Studio Code to work with Unity?
When it first fires up Visual Studio Code:
Extensions for Visual Studio Code: