Try going to Edit>Preferences>External Tools> Set your External Script editor to the correct version of vs, and then click "Regenerate project Files" button.
Open Package Manager in Unity and find the "Visual Studio Code" package that's installed in your project. Update it to new version
Try going to Edit>Preferences>External Tools> Set your External Script editor to the correct version of vs, and then click "Regenerate project Files" button.
I see errors like this in my projects from time to time, and this almost always seems to fix it.