VM loing SSH issue

Hi I am new to harvester and i need to login to a existing VM. I’ve added my ssh public key to the VM by editing the config and then restarted the VM. But I am not able to login to the VM. What could be the reason for this.