The best thing you could do is download Visual Studio 2022 which is kinda better for C++/C/C# related programs, you could follow this guide by microsoft: https://learn.microsoft.com/en-gb/cpp/overview/visual-cpp-in-visual-studio?view=msvc-170 or follow any recent youtube tutorial.
However if you need to use VS Code then first make sure you have the C/C++ extension installed it is from Microsoft. Then it is also recommended to install Code Runner extension as it helps run the code easily, it will show output in the Output Panel, you could also configure it to show the output in terminal if you want.