Children learn most of what they know from their parents. Their observation of what you do is what needs to concern you the most. It is the work of the parents to teach their kids what value to uphold and how to act responsibly. We live at a time when interaction with the internet is a major part of life. We tend to get so much from the internet. No other information and communication tool in our history compares. But to use it well, one has to be responsible about it. Your kid will inevitably access the internet, which makes it your job to ensure they do so properly when the time comes. Here are some of the things you can do.
They need to understand the difference between bad and good behavior online. The same approach you use to show them right from wrong in other areas of life applies here as well. You need to tell them not to ever engage in cyberbullying. You need to let them know the need for them not to hurt others online. The same thing happening to them would not be a pleasant experience. They need to see the value in being kind to others. As they come to appreciate all the positive influences, they will shun any negative ones that come their way.
You need to put in place parental controls and find a kid-friendly search engine. This is how you will know more about the kind of sites they visit. This is also how they will have no ability to go to bad sites. Tell them of the good sites they can visit, and the amount of info they can share. Oversharing is what has gotten many kids in trouble online.
When they are older, you can tell them of the laws their online behavior is related to. They will now see what consequences await those who harass others online. Another example is the grave consequence of them sharing nude photos with friends. By violating the child pornography laws, they will be categorized as sex offenders. They may have been cheeky, under peer pressure, or going through blackmail, but they will now pay for it for the rest of their lives. Speaking out beforehand should be their primary reaction.
There is a need for you to set a good example. Kids tend to emulate more of what you do, and less of what you say. By observing how you prioritize those internet access gadgets, they shall form some strong baseline behaviors. Do better.