Exodus 34:6-7 New International Version (NIV)
6 And he passed in front of Moses, proclaiming, “The Lord, the Lord, the compassionate and gracious God, slow to anger, abounding in love and faithfulness, 7 maintaining love to thousands, and forgiving wickedness, rebellion and sin. Yet he does not leave the guilty unpunished; he punishes the children and their children for the sin of the parents to the third and fourth generation.”
Many people think that God has wrath and is to be feared. God assured Moses of his nature. God is merciful, gracious, loving, and forgiving. God is not vengeful. God is slow to anger and his love for us can never be diminished. Why would our sins and sin nature affect children and grandchildren? We are affected by our parent’s sins like alcoholism for example. That is an obvious sin. We are also affected by less obvious sins like selfishness and greed. These can be passed along too. Do not treat sin casually. Repent and turn from it. Look to God for help. He will always be there for you. Go through a little pain now to change. The change will do you good and will do good for generations that come after you.