The same way you prevented adults buying pornography for kids prior to the web, and the way you prevent adults from buying beer for kids now.
Namely, you don't prevent it (I was 11 when I first saw hardcore pornography, on a VHS tape, at a sleepover party), but it does place a (surmountable) barrier in the way, which will reduce access to some degree. The degree to which that happens depends on a lot of things that are hard to predict. We have culturally normalized access to a lot of things for children, and reversing that will likely take more than just changes to a law.