There's no straightforward way. After all, VPN is designed to be an unknown middleman between the client and the server. It will defeat the purpose of a VPN if it can be easily detected. There are some escapes, but they have no guarantee.
One relatively easy way is to check your own public IP, as VPN will try to disguise, it's very likely to have an uncommon IP than the one your ISP assigns. You can hit
https://ifconfig.me/ip to get it, which will give you a text based response like this:
this method is agnostic to the VPN service, but ISPs like to use dynamic public IP and if the VPN server is in the same country, it might be tough to check.
The second method is easier, but requires knowledge of specific VPN service. NordVPN, for example, can be easily queried:
$ nordvpn status
Status: Disconnected
A single line of SysUtils.ExecuteProcess is sufficient. But then again, it has to be adapted to whatever VPN service you use and ensure it has a tool that can give similar output.
There are more ways, but they're all more difficult to do, so I suggest just the two above.