Get him a laptop early. Teach him how to make things. Separate “creative time” from “consumption time”. Get a router that gives you good controls for total time and time schedule. The TP-Link Deco series is what I use and it does the job. Avoid a real smartphone for as long as possible. 9th grade would be ideal. Give other ways to communicate - smart watcj, dumb phone, Discord on laptop. This is about manners, litera…
Are you worried about the openness of acesss with discord, I recommend the same then my partner was like what about the randos and I didn't have an answer...
Beyond that, they are going to encounter randos and need to build the toolkit for navigating those situations. Don't interrogate but try to casually chat with them sometimes about what they've been up to: anything cool, anything weird, any new hangouts.
I don't know what kids and parents are doing today with minimum age requirements for chat app usage (13 is the minimum in most places but this seems to be ignored frequently) but pre-teens might still to talk to you about weird things they encounter. You will become less cool to talk to when they are in high school but they'll still absorb anecdotes even if they scoff and roll their eyes throughout the entire conversation. If you're concerned and they don't like talking about it, an older sibling, cousin, friend's older kid, might be able to casually check how things are going without triggering the "ew, parents" reflex.