I should confess and tell you that I use git for windows to access my pi, so git-bash gives me a minimal bash environment on Windows. You may prefer Putty or WSL etc. This method will work with Mac, Linux and WSL, and it answers the OPs question of "How do I".
- Assign the pi a static ip address
- use ~/.ssh/config to create your ssh "address book"
### Default settings for all Hosts if not declared above
# ServerAliveCountMax 30
Now save the file. From the command line you can easily ssh onto your target server:
But you could just as easily change the Host field to something very convenient such as "pi" so you could use:
See also: https://linuxize.com/post/using-the-ssh-config-file/