A kid will act in a certain way mostly from what they see their parents doing. They especially learn most of what they do from them, which is of more concern. It is the responsibility of the parents to teach their kids proper values and the way to act responsibly. In this age of the internet, you will have to work out how our kids interact with that resource. The internet affords us so much to take. You shall not find anything else that can give you that much access to that much information at once. But to use it well, one has to be responsible about it. There is no denying that at some point, your kids will interact with the internet, thus making it a top priority for you to get them prepared for that time. Here are what you need to focus on.
You need to show them what constitutes bad behavior, and what good behavior looks like. You need to take the same approach of showing them what is right from wrong in other areas of life and apply it here. They should know how bad cyberbullying happens to be. They need to know the importance of not hurting others online. If they were on the receiving end, they would not like it any better. They should learn to be kind to others. When they see a positive way of navigating the internet, any negative and malicious influences shall not stick.
You need to put in place parental controls and find a kid-friendly search engine. This shall help you keep tabs on the websites your child visits. This is also how they will have no ability to go to bad sites. They need to know of the good sites they can visit and what info they can freely share. Oversharing is what has gotten many kids in trouble online.
As they get older, you need to let them know which laws govern online behavior. This is how they get to learn of what it means b law to harass others. Another example is the grave consequence of them sharing nude photos with friends. That is seen as a violation of the child pornography laws, and could earn them the unenviable title of a sex offender. 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. Let them be free enough to tell you about it the moment it happens.
You should at all times 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. You need to behave accordingly.