This type of authentication is considered to be among the most secured ones. You can setup this config in two steps.
First, you need to generate a public/private key pair. Use default location. Be careful to not override existing keys.
Then, install a public key on your server:
If that for some reason does not work, use more manual approach:
$ cat ~/.ssh/id_rsa.pub | ssh username@remote_host "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
You’ll find more details here.