Children are blessings from God that's why you ought to teach then the fear of the Lord starting from when they are small to that they will grow with it. As we can see in Proverbs 22 vs 6 and that is the obligation of a good parents to train a child in a way of God.
Training a child in the way of the Lord is a continous effort which require grooming the child with the word of God, making him/ her understand the reality of the word of God, how God works and deeper understanding of God.
A child trained with God's word brings blessings but a child that is not trained by God's word will bring troubles to the family and society as seen in Proverbs 10 vs 1 and also in Proverbs 17 vs 25.
Though we will encounter difficulties in training a child but do not give up because they are blessings from God and also when they trained in line with God's word the challenges will a story someday.