A VPN that you set up in System Settings, Network usually gets switched on with a click. That click is hard to put in a script. scutil has a little-known set of VPN commands that do the same thing.
The option is --nc, and scutil --nc help prints the full list. Start by listing the connection services in your current network set, with their names and status:
scutil --nc list
Then use the name you see there, in quotes when it has spaces:
scutil --nc start "Office VPN"
scutil --nc status "Office VPN"
scutil --nc stop "Office VPN"
status tells you whether the service is connected and adds extended details. show prints the configuration and statistics the bytes and errors. An example where I’d use it: a script that starts the work VPN, mounts a share and stops the VPN again when the job is done.
The caveat is about passwords. start accepts --user, --password and --secret, but anything you type there ends up in your shell history and in the process list. I’d let the password come from the keychain, which is where macOS keeps it when you save it in the VPN settings, and leave those options out. Also, this only covers services that macOS itself knows as network connections. A tool like Tailscale has its own command line, and that is the one I’d use for it.
Further reading: scutil man page (ss64), scutil –nc source (Apple open source)