Hi mabutho192,
welcome to the Apple (user-to-user) Community.
Wondering if the iOS version on the new second-hand iPhone X has been updated to latest iOS version.(iOS 16.5)
It may be a good idea to update the iOS version, before trying to update apps, so everything stays compatible..
Wondering if the iPhone has been properly prepared for you, as the new owner:
Eg: What to do before you sell, give away, or trade in your iPhone or iPad - Apple Support
______________________________
Re: "i.e can’t connect to the internet"
Wondering if the iPhone is connecting to wi-fi ok, or if a SIM card / cellular plan / is supporting cellular data.
Connect to Wi-Fi on your iPhone, iPad, or iPod touch - Apple Support
and
How to: Connect iPhone to the internet - Apple Support
If you wish: How to: Update your iPhone or iPad - Apple Support
_________________________________________________________________
If internet access is still a difficulty:
You may be able to update the iPhone's iOS version to the newest iOS version using a computer that is connected to the internet. NB: iPhone would need to be well-charged.
Eg:
Using a Mac that is running macOS Mojave or earlier.
Update your iPhone, iPad, or iPod touch with iTunes - Apple Support
or
Using a Mac with macOS Catalina or later:
Update your iPhone, iPad, or iPod touch with the Finder - Apple Support
How to: Connect iPhone and your computer with a cable - Apple Support
_________________________________________________________________________________________
When the iPhone's iOS version is recent, and iPhone has internet access, access to the App Store may be ok.
How to: Get apps in the App Store on iPhone - Apple Support
Else:
You may need to first sign in on your updated iPhone, Mac or other device with your Apple ID
Sign in with your Apple ID - Apple Support
( If you do not have an Apple ID Account: How to create a new Apple ID - Apple Support )
It seems Apple requires a valid payment method in your Apple ID account, for the first time you use the App Store, or iTunes, even if you only download free apps. Check which payment methods Apple can accept in your country.
Payment methods that you can use with your Apple ID - Apple Support
How to: Add a payment method to your Apple ID - Apple Support
________________________
Trouble-shooting if needed:
If you can't connect to the App Store, iTunes Store, or other Apple services - Apple Support
If you can't open the App Store or iTunes Store, buy content, or edit payment information - Apple Support
If you can’t download or update apps on your iPhone or iPad - Apple Support
______________________
More Support, if needed:
There are "Get Support: start now" links (online chat, phone, eMail etc.) at the bottom of the websites listed below
iPhone - Official Apple Support
App Store - Official Apple Support
All the best :-)