The private key is still in ~/.ssh, but the .pub file next to it is gone. Or you have a few keys lying around and no idea which public key belongs to which. Neither needs a new key pair, because the public key can always be derived from the private one.
ssh-keygen -y -f ~/.ssh/id_ed25519
-y reads a private key in OpenSSH format and prints the matching public key, and -f names the file. If the key has a passphrase, ssh-keygen asks for it first.
To put the missing file back:
ssh-keygen -y -f ~/.ssh/id_ed25519 > ~/.ssh/id_ed25519.pub
I’d also use it to check whether a key matches a line in a server’s authorized_keys, or a .pub you found somewhere. This compares only the key type and the key itself, so a different comment at the end doesn’t count as a mismatch:
diff <(ssh-keygen -y -f ~/.ssh/id_ed25519 | cut -d' ' -f1,2) \
<(cut -d' ' -f1,2 ~/.ssh/id_ed25519.pub)
No output means they belong together.
Two things to watch. The comment at the end of the line (often user@host) may be missing or different from what your old .pub had, so add it by hand if you rely on it to recognise keys in authorized_keys. And be careful with the >: point it at the .pub name, never at the private key file, because the shell empties the target before ssh-keygen even reads anything.
Further reading: ssh-keygen(1) manual