The main advantage of Vagrant in my understanding is to allow each developer to use the native resources of their environment during development (eg, text editor, IDE, etc.) but the execution environment ( ) is identical for all of them - and this is identical (as far as possible) to that which will be used in production.
The first step, as you have already noted, is to install and run a virtual machine. But which? Now, the one that is most similar to the environment in which the system will actually run. If it is a client-server architecture, the virtual machine must use the same operating system as the server, have installed the same packages that will be present on the server (and the same version), etc. If it's a cross-platform system, which needs to run in a variety of different environments, then you would create a separate virtual machine for each of them (without having to keep all of them running at the same time, of course).
Once you have defined the virtual machine (s) to be used, and how it will be configured (you can either pre-install a dependency set, or create a startup script for each virtual machine to should be made available to each developer of your team so that everyone works in an identical environment.
The last step is to map a set of folders from the host environment (i.e. your computer) to a set of folders in the host environment (i.e. the virtual machine). This allows you to edit files, model, etc. using your preferred tools (which may differ from those of your colleagues), but when compiling and executing everything is done within the virtual environment. Thus, when running, the differences between computers have their impact minimized, being restricted only to performance (i.e., the ability of the host system to emulate the guest system).
Nothing prevents you from compiling / executing on on your own computer, of course, if it provides a compatible environment. The important thing is that you never make ("check in") files that have been tested only on your machine. Instead, before putting your modifications into version control you should open each virtual machine (if there is only one, best leave it open straight) and test the system on it, to ensure that what works in one environment does not cause bugs in another.