I have never really explored the workflow in Emacs but I believe if you just open a terminal and ssh from there you will only have that terminal connected to the SSH session. Emacs has support for connecting (similar to VSCode) through TRAMP Mode which from my understanding will cause the normal “find file” etc to act on the remote file system.
On that note, I can recommend you look into using vterm, I have found it to be a much greater experience than M-x term.
You can enable it through .doom.d/init.el
(it needs libvterm as well though).