How to run Julia project in VS Code?

WARNING: replacing module QuantumOptics.
Main.QuantumOptics

this comes about because the module was already defined after using QuantumOptics.

But you want something else. The example are not defined anywhere in the package source. The package defines the functions used in the examples, e.g. Pumped cavity · QuantumOptics.jl

You should copy-paste from there, or look at https://github.com/qojulia/QuantumOptics.jl-examples Clone that repo and run those notebooks. For that you will need to install the Julia kernel for Jupyter called IJulia. Ignore the statements in the README about converting the notebooks to markdown. You can use them interactively.