As is common in social science, it's really challenging to disentangle this kind of thing. But there are ways you can get at it.
One clever example discussed in the blog I linked:
> We also found five studies that used a similar design applied to the rollout of high-speed internet. It’s hard to have a phone-based childhood when data speeds are very low. So what happened in Spain as fiber optic cables were laid and high-speed internet came to different regions at different times?
https://www.afterbabel.com/p/social-media-mental-illness-epi...