If you have a Privacy SSH key but need to regenerate the public key again, use ssh-keygen -y
-y This option will read a private OpenSSH format file and print an OpenSSH public key to stdout
ssh-keygen -y -f ~/.ssh/id_ed25519 > ~/.ssh/id_ed25519.pub
Enter passphrase:
This will save the public key to ~/.ssh/id_ed25519.pub.