Generate an SSH key pair via ssh-keygen in your terminal (make sure not to overwrite an existing key!).
ssh-keygen
Add the configuration in .ssh/config to your local SSH configuration file.
.ssh/config
Point the IdentityFile parameter to your local key file location (in most cases ~/.ssh/id_ed25519 or equivalent with RSA).
IdentityFile
~/.ssh/id_ed25519
Go into your Gitea Settings, then SSH/GPG Keys section, then upload your public key (in most cases, a file called id_ed25519.pub).
id_ed25519.pub
You can now contribute code!