Xcode Build Error: No account for team "S23Q9DM44M"
When you're building an app to run on an iPhone, it needs to be code signed. Signing is tied to your Apple developer account, so you must be logged in to that account in Xcode in order to sign the app-- even if you're not going to use the app store. You can't build the app and deploy it to an iPhone without signing. The simulator doesn't need signing, which is why it works there.

S23Q9DM44M is a team ID. It might be a team you belong to, or it might be another team (if you got this project from someone else). Xcode is telling you that it doesn't currently have access to this team, so it can't sign the app.

You need to:


Go to Xcode preferences, in the "accounts" section, and log in to your Apple developer account. If you don't have an account, you need to create one first. You can do this at https://developer.apple.com/programs/. It's free if you're not going to use the app store.
Go to this project's "signing and capabilities" settings. In the "team" section, make sure the correct developer team is selected. This might just be your name, or it might be a company or group that you work with. Then, check the provisioning profile setting. It might say "Xcode managed profile", in which case you're set. If it shows a pop-up menu, use it to select a provisioning profile.


Update: I tried the Github project you linked to. Besides the above, you also need to change the bundle ID for the app. Your question doesn't mention any bundle ID issues but that's because you had something else to fix first.

The bundle ID of iOS apps must be unique since it's how iOS identifies the app. Apple checks the bundle ID when compiling and tries to register it with your developer account. If someone else is using the ID then you need to change it. This is also found in the "signing and capabilities" page in Xcode. The ID can be anything unique but the normal format is a reverse domain name-style ID. For example your domain were apple.stackexchange.com then you might use com.stackexchange.apple.barcodescanner.