When you run Visual Studio Code after installing it, you might encounter the following error:
You are trying to start Visual Studio Code as a super user which isn't recommended. If this was intended, please specify an alternate user data directory using the `--user-data-dir` argument.
The solution is simple. You should just pass some parameters, --user-data-dir and --no-sandbox, like this:
#code [working directory] --user-data-dir='.' --no-sandbox
Additionally, in my case, using Kali, another problem arises. Since there are many parameters to be passed, I attempted to alias it as an abbreviated command in ~/.bashrc. However, ~/.bashrc did not seem to be functioning properly.
As an alternative, I created a shortcut file in /usr/bin, and wrote the above command within it:

Now Visual Studio Code runs smoothly:

https://askubuntu.com/questions/803343/how-to-run-visual-studio-code-as-root