Make sure they receive appropriate education. Monitor each time they use the internet. Ban social media until they turn 18.
My son is only 19, he’s already far more conservative than his schoolmates. He develops his own opinions and we sometimes discuss how he arrives at them. Since he arrives at his own opinions in his own way, he finds it far easier to hold to them than if his opinions were delivered to him.