Using the ssh-keygen command

TLDR

Rule of thumb of the byte length of each encryption

ssh-keygen -t rsa -b 4096
ssh-keygen -t ecdsa -b 521
ssh-keygen -t ed25519 -a 100

ssh-keygen with options

To add a comment when generating the key you can add the -C option

ssh-keygen -t ed25519 -a 100 -C "Comment"

We can extend the command with the -f option to save it with a custom name

ssh-keygen -t ed25519 -a 100 -C "Comment" -f ~/.ssh/my_ssh_key