Actually, joking aside, your advice doesn't seem to match the two-character string `~.` in the article. (Maybe your advice is meant to try first to see if the SSH session is really frozen, or if the remote shell is responding?) On the other hand, the article itself seems of two minds about what that two-character string does:
> To view a list of available options with this escape trigger type `~.`.
> To force terminate a frozen SSH session, press `~.`.
(As far as I can tell, in each case, one of those periods is the sentence ender and one is the command to terminate.) Unfortunately, I don't have anywhere to SSH to to check ….
Sometimes plain ~. just doesn't work, depending on what state your connection is in.
I can't imagine what state that would be. It should work even if the remote machine is completely unresponsive.