I am a beginner to Ubuntu and Linux.
It is favoring the command line and combination of simple tools
(e.g. in a command pipeline for your unix shell in some terminal emulator). A successful command (e.g. cp(1), used to copy files, or g++(1), a C++ compiler, or man(1) to read documentation, and od(1) or less(1) to inspect a file, or ls(1) to list them) often stays nearly silent when successful; see intro(1). Be aware of syscalls(2) (see also intro(2)). Remember that some parts of your C++ code could be generated (by metaprogramming tools such as ANTLR, swig, or GNU bison or GNU autoconf or GPP, or your own Guile, Python or GAWK or GNU bash script, or some other C++ program, etc...). See also Linux From Scratch. Every executable and process (except /sbin/init) is started by execve(2) with fork(2). See also ps(1), top(1), pstree(1) and proc(5).
Your C++ compiler could be GCC (or else Clang). Be sure to read the documentation on invoking GCC, and about your C++ preprocessor (perhaps GNU cpp). Try g++ --version then g++ --help in some terminal emulator.
If that command works, compile your HelloWorld.cpp with all warnings and debug info, so run in your terminal g++ -Wall -Wextra -g HelloWorld.cpp -o HelloWorld; you later run the obtained executable using ./HelloWorld in the same terminal (read about the $PATH variable in environ(7) and try the printenv(1) command).
Of course, you'll use some IDE or source code editor (e.g. Visual Studio Code, vim or GNU emacs or geany). Be sure to take some time to read its documentation. You'll configure them to run some build automation tool. You surely want to use some version control system, such as git.
And you'll need a debugger such as GDB.
Later, you'll want to use some build automation tool to drive your compilation commands (of several translation units) and the linking command (part of GNU binutils). Consider for your build automation using GNU make or ninja or many others.
Read of course Advanced Linux Programming and some good C++ programming book (and reference website). Be aware that C++ is a very difficult and complex programming language (see its spec n3337).
You could enjoy reading some textbook on operating systems. Study for inspiration the source code of existing open source C++ programs (e.g. on github), such as the fish shell.
c++is not a scripting language. The term "run c++ files" is not technically correct. You don't run c++ files at all. You compile them into object files which a linker may (depending on your commands) turn it into an executable application that then you can run.tasks.jsonandlaunch.json