You can learn how to compile C++ in VSCode by installing the "C/C++" extension by Microsoft.
Go to visualstudio.microsoft.com and click Download Visual Studio (the free Community edition is sufficient for individual developers, students, and open-source projects). c++ install windows 11