First, add your account in Xcode:
Go to Xcode → Settings → Accounts and sign in with your Apple ID
Then open your project → Signing & Capabilities
Enable Automatically manage signing
Select your Team from the dropdown
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags: