Sometimes when I use SSH connection hangs, mostly because of network instabilities. SSH client waits for timeout, and in this time you can’t do a lot.
Formely I used to kill ssh process, but it was inconvinient and error prone. I learned different way, you can just type:
Enter and then ~. (tilde and dot) and SSH client gracefully terminates.
There are also other sequences. To show list of all possible type Enter and then ~? (tilde and questionmark) in your ssh connection.