How to Use Visual Studio Code for Beginners

February 27, 2026 · 6 min read · 354 views · Coding for Beginners Programming Tutorial VS Code
How to Use Visual Studio Code for Beginners

Most VS Code tutorials teach you where the menus are. You will find the menus. What actually separates someone who is productive in VS Code from someone fighting it is three things: the Command Palette, the right extensions, and understanding which Python your terminal is running.

This covers the setup, and then the parts that are genuinely non-obvious.

Install it

Download from code.visualstudio.com and run the installer.

On Windows, tick Add to PATH during installation. It is easy to miss and it is what lets you type code . in any folder to open it there — which becomes the way you launch it almost immediately.

VS Code is free and genuinely open source at its core. The Microsoft-branded build adds telemetry and proprietary extensions; if that matters to you, VSCodium is the same editor without them.

Open a folder, not a file

This is the first thing people get wrong.

VS Code is folder-oriented. Open a folder (File > Open Folder) and you get the file explorer, project-wide search, an integrated terminal that starts in the right place, and per-project settings. Open a single file and you get a text editor with syntax highlighting and not much else.

The folder you open is called the workspace, and nearly every feature is scoped to it. If a tutorial tells you to run a command and it cannot find your file, the usual reason is that you opened the file rather than the folder containing it.

The Command Palette is the whole editor

If you learn one shortcut, learn this one:

Ctrl + Shift + P        (Cmd + Shift + P on macOS)

The Command Palette is a searchable list of every command VS Code and its extensions can perform. You do not need to know where a setting lives or what it is called — start typing what you want and it will find it.

Some worth trying immediately:

Type thisWhat it does
Format Documentreformats the current file
Python: Select Interpreterchooses which Python runs your code
Preferences: Color Themechanges the theme
Terminal: Select Default ProfilePowerShell, cmd, bash, zsh
Developer: Reload Windowfixes most "extension went weird" states

Dropping the > prefix turns it into a file search instead, which is faster than clicking through the explorer once a project has more than a few files.

The other shortcuts worth knowing on day one:

  • Ctrl + P — jump to any file by name
  • Ctrl + ` — toggle the integrated terminal
  • Ctrl + B — hide the sidebar for more room
  • Ctrl + / — comment or uncomment the selected lines
  • F2 — rename a symbol everywhere it appears
  • Alt + ↑/↓ — move the current line up or down

Install the extension for your language

An empty VS Code is a text editor. Extensions make it an IDE, and for most beginners there is exactly one that matters: the official extension for the language you are writing.

Open the Extensions view (Ctrl + Shift + X) and install:

  • Python (Microsoft) — if you write Python. Brings autocomplete, error underlining, debugging and test running
  • ESLint — if you write JavaScript
  • PHP Intelephense — if you write PHP

Resist installing more than that at first. Extension packs marketed as "must have for beginners" mostly add competing autocomplete engines that produce contradictory suggestions, and when something misbehaves you will have no idea which one caused it.

Write and run something

Create a file called hello.py — the extension matters, because it is how VS Code decides which language features to apply.

name = input("What is your name? ")
print(f"Hello, {name}!")

Open the terminal with Ctrl + ` and run it:

python hello.py

On Windows, if python opens the Microsoft Store, use py instead:

py hello.py

That Store redirect is a Windows stub for when Python is not installed. If you hit it, install Python from python.org and tick Add python.exe to PATH in the installer.

The interpreter trap

Here is the one that wastes a beginner's afternoon.

VS Code can have a different Python selected than the one your terminal uses. So the editor shows no errors, autocomplete works, and then running the file fails with ModuleNotFoundError for a package you are certain you installed.

What happened: you installed the package with the terminal's Python, and the editor is inspecting a different one.

To check which the editor is using, look at the bottom-right of the status bar — it shows the interpreter. To change it, open the Command Palette and run Python: Select Interpreter.

To check which the terminal is using:

python -c "import sys; print(sys.executable)"

Make those two match and the class of problem disappears. Once you start using virtual environments, select the interpreter inside the environment and VS Code will activate it in new terminals automatically.

Two settings worth changing immediately

Open settings with Ctrl + , and search for these:

Format On Save. Turn it on. Your code gets consistently formatted every time you save, and you stop thinking about whitespace permanently.

Auto Save. Set it to afterDelay. The number of people debugging code they have not saved is larger than anyone admits.

Common problems

"python is not recognised." Python is not on your PATH. Reinstall it with Add to PATH ticked, then restart VS Code entirely — it reads the PATH at launch, so a reload is not enough.

The terminal opens in the wrong folder. You opened a file rather than a folder. Use File > Open Folder.

Autocomplete stopped working. Run Developer: Reload Window from the Command Palette. If that fails, check that exactly one language extension is installed for that language.

Errors underlined that are not real. Usually the wrong interpreter selected, so the editor is checking against a Python that lacks your packages.

Where to go next

Once the editor is set up, the useful next step is building something with it rather than learning more of its features. The companion piece, Building Your First Python Project in VS Code, walks through a small program end to end.

If you write markdown in VS Code, Ctrl + Shift + V opens a live preview beside your file — or use the Markdown Previewer for a quick check outside the editor.

Frequently Asked Questions

Is Visual Studio Code the same as Visual Studio?

No, and the names cause real confusion. Visual Studio is a large Windows IDE aimed mainly at .NET and C++. Visual Studio Code is a lightweight cross-platform editor. They share a brand and almost nothing else.

Why does my code work in the editor but fail in the terminal?

Because they are probably using different Python installations. Check the interpreter in the status bar, run python -c "import sys; print(sys.executable)" in the terminal, and make the two match with Python: Select Interpreter.

Which extensions should a beginner install?

Just the official extension for your language — Python, ESLint, or Intelephense for PHP. Add more only when you hit a specific problem they solve. Large "beginner" extension packs tend to install competing autocomplete engines that disagree with each other.

What is the Command Palette?

A searchable list of every command available, opened with Ctrl + Shift + P. It means you never have to remember which menu a feature lives in — you type what you want to do and select it.

Do I have to pay for VS Code?

No. It is free, and the core is open source. The Microsoft build includes telemetry and some proprietary extensions; VSCodium is the same editor built without them if you would rather avoid that.

Why does `python` open the Microsoft Store on Windows?

Windows ships a stub that redirects to the Store when Python is not installed. Install Python from python.org with Add python.exe to PATH ticked, or use the py launcher instead.

Related Tools & Apps

Related Posts

ESC