This article is assuiming that you have already have an approved paid membership to the Apple Developer Program. If not, you can obtain one at developer.apple.com.
First, log in to App Store Connect at appstoreconnect.apple.com and click “My Apps”. Then, click the plus button (shown in the image) as indicated below and follow the directions.
Remember to use the same bundle ID as in Xcode.
After filling in all the text fields, navigate to your finished app in Xcode and select generic iOS device as the build target.
In the top menu, click Product > Archive.
Rember to select your paid developer account in codesigning.
When the Archive is complete, select Distribute app and follow all the onscreen instructions until you see the green check mark. If it failed, try again or contact Apple Developer Support.
Once the green check mark appears, go to App Store Connect and click submit for review. If there is an error on the page, ensure that all the fields are filled including the rating field.