Thanks for the post, the forum is the correct place as many developers here have gone over the same issue probably and hopefully their suggestions can help you get back into coding again in Xcode.
I do not have a personal Xcode account but looks like you may have moved computers or deleted the private key somehow? Or at least that seems what the error seems to me.
When you lose the private key usually due to switching Macs, reinstalling macOS, or deleting it from Keychain and hit the certificate limit, Xcode resolves it automatically. Let Xcode do the work in you are running the latest version? What version of Xcode are you running?
Quit Xcode first. Open Keychain Access find the "Apple Development" certificate that is missing the private key and delete it. Open Xcode and go to the Accounts. Click Manage Certificates. Click the + button in the bottom left of the window and select Apple Development.
Revoke and Request or Reset button. Xcode will revoke the broken certificate on Apple's servers and generate a fresh one with a new private key.
Maintaining your signing identities and certificates: TN3161: Inside Code Signing: Certificates | Apple Developer Documentation
Adding your Apple ID account in Xcode: https://developer.apple.com/help/account/provisioning-profiles/create-a-development-provisioning-profile/
Hope this is helpful to you.
Albert WWDR