Adding to what others said, want to drop a few practical tips that nobody really talks about.
The Conversation First Approach
Sit him down once before you do anything. Tell him you saw something that worried you, mention it specifically, ask him to explain. Sometimes the messages that look shady to a parent are kids being dumb or copying meme stuff. Other times it is genuinely bad. You will know from his reaction. If he gets defensive in a way that feels off, then you have your answer about whether to dig deeper.
Check the Phone Bill
Most parents forget this. Your carrier provides itemized text logs through the online account. You see every number he texts and the time and date, just not the content. If you see a number that messages him at 3 am every night or a sudden spike of texts with one unknown contact, that is a flag worth following up on.
Look at His App Drawer Carefully
Kids hide stuff in plain sight. Apps like Calculator+ or Vault look like utilities but are private messaging or photo hiders. Also check for duplicate apps, like two Instagrams. The second one is usually a secret account. On Android, swipe through every page. On iPhone, scroll through the App Library, not just the home screen.
Browser History Is Gold
Even careful kids forget to clear it. Safari, Chrome, whatever he uses, the history shows search terms and visited sites. Combined with patterns from his texting buddies you get the full picture.
The Long Tail of Tools
People mentioned a few above already so I will not repeat names. Just know that whichever route you go, none of them give you a clean 100 percent picture. Kids these days use disappearing message apps and ephemeral platforms by default. You will catch some stuff, miss other stuff. Manage expectations.
Lastly
Whatever you find, do not immediately confront with “I saw your messages”. That nukes the trust forever and he will never bring you a real problem again. Instead use what you learn to start better conversations, set better rules, and decide if professional help like a counselor is needed. Sometimes shady messages are a symptom of something bigger going on at school or with friends.