Call each one separately
You can start a specific version of an application by providing the full path name of the executable. Firefox, e.g., installed using APT will be launched by
/usr/bin/firefox. The executables of snap applications are under
/snap/bin/firefox will launch the snap version.
firefox will launch the APT version, because
/usr/bin is listed earlier in the search path than
/snap/bin in a default Ubuntu install. The default PATH is:
$ echo $PATH
When you simply type
firefox, the system searches each of the consecutive directories (folders) until an executable with the name
firefox is found. If the APT version is installed, it will find the executable in
/usr/bin before searching
/snap/bin, so the search will be stopped and that executable will be launched.
You can learn which executable will be launched with the command
$ which firefox
You can learn which executables you have installed with the command
$ whereis firefox
firefox: /usr/bin/firefox /usr/lib/firefox /etc/firefox /snap/bin/firefox /usr/share/man/man1/firefox.1.gz
Here, both the APT and the snap version of firefox are installed.
Know which one is running
ps ax lists all running processes. Thus:
ps ax | grep firefox
will list all processes with the name "firefox". The output includes the full pathname of the executable.
Creator of a specific window
It is also possible to identify the creator of a specific window, to learn whether the open window is from the APT or the snap version. However, this is rather complicated and not always reliable. See the Unix & Linux Stackexchange questions here and here.