I have just downloaded unity and saw that now it supports Visual studio code, I downloaded it and made it the default editor.
After trying to edit a script, it prompted
I installed an older version of c# vscode extension, version 1.16.21, and it is working.
c# vscode extension
version 1.16.21