Depends on what you mean by child. If you mean young teen, under the age of consent, or even younger, then I would remove the material immediately, and talk to them about it, finding out where they got it from (because if an adult gave it to them, then that would be very worrying, and the police would need to be involved if my child was being groomed), and making sure that they understood that this kind of material is not appropriate for them to be looking at. Under no circumstances would I shout at them, and I would try my absolutely best to make sure that the child did not feel embarrassed (or embarrassed too much - it would be difficult for them not to feel embarrassed being confronted with something like this). I would want to keep the channels of communication open, so that they could always feel that they could ask me questions about anything they needed to. I think it's important not to make them feel guilty, not to make them feel that they've done something wrong or disgusting - they may just be exploring natural urges and feelings and curiosities. But they do need to enter into a discussion with me about when and where it's okay to explore these feelings. I think that suppressing urges is dangerous, and I think that honesty is the best policy when it comes to sex. For me, I feel that it's best to arm them with as much information as possible so that when they are old enough to make those choices, they are making them when fully informed.
If you're talking about a teenager who is of age, i.e. old enough to have consensual sex and therefore deemed old enough in law to make their own choices, then I would leave it alone. If the material was disturbing stuff, child pornography for example, then I'm not sure what I'd do. I would probably apply the same approach as mentioned above - remove the material, and talk to my child about where it came from, and try to ensure that they would talk to me if they felt the urge to seek out such material again. Much more difficult in this kind of circumstance.