Start by checking that there aren't any previous ssh keys inside the FIDO2 authenticator of your YubiKey. You can check if they exist by running the command below:
nix shell nixpkgs#yubikey-manager -c ykman fido credentials list
If the command above outputs a string mentioning "ssh" or "openssh", then you have already got a key generated and store on your YubiKey.
Before generating a new ssh key to store on your YubiKey you must consider which additional required authentication factors you want to use. Below you can see a table with the available factors and their corresponding command: