How do you ssh from PyCharm into a vm?

I am trying to run a TensorFlow project, but I found that TensorFlow does not support M1 macs. My work around solution to this issue is by trying to ssh into one of my vms, Kali Linux on UTM or Ubuntu on VMWare fusion. How would you go about achieving this?