Cause 1 of 5
No key exists, or the public key is not on your account.
Test first: ssh -T git@github.com names the account when it works. If it fails, generate a key with ssh-keygen -t ed25519 -C "you@example.com" and add the contents of ~/.ssh/id_ed25519.pub in the host's SSH keys settings. Upload only the .pub file — the file without the extension is the private key and must never leave your machine.
Cause 2 of 5
The agent is not running, or does not hold the key.
eval "$(ssh-agent -s)" then ssh-add ~/.ssh/id_ed25519. On macOS, ssh-add --apple-use-keychain ~/.ssh/id_ed25519 keeps it loaded across restarts.
Cause 3 of 5
The key has a non-default filename and nothing maps it to the host.
SSH only tries the standard names on its own. Add an entry to ~/.ssh/config: a Host github.com block with IdentityFile ~/.ssh/my_key and IdentitiesOnly yes, so it offers that key and stops after it.
Cause 4 of 5
The private key file permissions are too open.
SSH refuses to use a private key that other users can read. chmod 600 ~/.ssh/id_ed25519 and chmod 700 ~/.ssh are the correct modes — tightening, not loosening. A key at 777 is exactly what SSH is protecting you from.
Cause 5 of 5
The key belongs to a different account, or you only have HTTPS access.
ssh -vT git@github.com prints every key offered and the server's reply, which identifies the wrong-account case immediately. Switching the remote to HTTPS with a personal access token is a valid alternative: git remote set-url origin https://github.com/you/project.git.