20 The soul that sinneth, it shall die. The son shall not bear the iniquity of the father, neither shall the father bear the iniquity of the son: the righteousness of the righteous shall be upon him, and the wickedness of the wicked shall be upon him.
21 But if the wicked will turn from all his sins that he hath committed, and keep all my statutes, and do that which is lawful and right, he shall surely live, he shall not die.
22 All his transgressions that he hath committed, they shall not be mentioned unto him: in his righteousness that he hath done he shall live.
23 Have I any pleasure at all that the wicked should die? saith the Lord God: and not that he should return from his ways, and live?
The reason people believe in generational curses is because of what looks like a contradiction in the law.
Thou shalt not bow down thyself to them, nor serve them: for I the Lord thy God am a jealous God, visiting the iniquity of the fathers upon the children unto the third and fourth generation of them that hate me;
But, the problem is that the context is about idolatry and the same way believers almost certainly teach their children to follow the same belief in YHWH, you also have the same tendency for idol worship. And so the actual sin keeps going on generation after generation. But each generation can be punished for their own idolatry. If we look at it this way then there is no conflict; which means that wrongs done by your ancestors have nothing to do with you unless those same wrongs were taught to you and you do them.