Make private + public keys. You can do this with ssh-keygen on Linux/Mac and PuttyGen on Windows.
For a website this means saving the appropriately formatted public key into the text box they provide.
For connecting to another machine you use ssh-copy-id. It will copy the key into ~/.ssh/authorized_keys on the server. It looks like this:
$ ssh-copy-id -i ~/.ssh/id_rsa.pub user@host
# Checks if key already works
user@host's password: # Password if needed
# Success!
The -i stands for "identity file".
There's a bunch of crap about adding your key to your ssh agent which is all trash because you can get around it by making a config file. Specifically ~/.ssh/config. It should look like this:
# Example for GitLab
Host gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitlab_com_rsa
And that's it!
Mostly for Windows cos ssh on Windows is trash.