There's potentially TWO issues:
- You may not be signed-in with your Apple ID within XCode.
- You may lack an Apple Developer Certificate, or your certificate has gone past it's expiration date. Some steps to fix:
FIRST
Sign in to your Apple Developer account online, and make sure your credit card is up to date. Go here...
https://developer.apple.com/sign-in-with-apple/
On the upper right (circa 2021) click "Account" to login. Once inside, check all your stuff especially credit card. If it's not letting you update your credit card, then either switch to an iOS device to do it in Settings, or just chill and go to the next step.

SECOND:
With XCode open, hit the upper left menu (next to the apple icon) "XCODE" and select 'Preferences...' then Accounts and sign-in. This essentially signs you in as yourself to XCode. Most times, this will be enough for the apps you're developing, but occasionally a pesky app might require you to sign in with your Apple ID on the SIMULATOR iphone! Yes, I know that sounds nuts, but pretend simulators are actual iphones, and you own them all-- you'd have to sign in to each device you own, right? Just something to keep in mind.
THIRD: Certificates
If you're lacking a certificate or it's expired, you can also figure this out in the same spot as above, but this time click on "Manage Certificates..." button on the lower right and either select your Developer Cert or create a new one.
For more information on Apple Developer Certificates:
https://help.apple.com/xcode/mac/current/#/dev3a05256b8