On the Server, run:

# Check current remote
git remote -v
 
# Generate SSH Key
ssh-keygen -t ed25519 -C "<Some Label>"
 
# Show the public key
cat ~/.ssh/id_ed25519.pub

Copy the public key and paste it into Github -> Repo -> Settings (Top Bar) -> Deploy Keys -> Add Deploy Key. Finally:

# Switch to SSH remote (Copy from GitHub -> Repo -> Code -> SSH)
git remote set-url origin git@github.com:<User>/<Repo>.git