Make sure Flatpak is set up on your system first. Then, add the Flathub repository with `flatpak remote-add –if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo. Finally, install VS Code with `flatpak install flathub com.visualstudio.code.