This passage conceals more than it tells. There are at least four ways to understand it. That "life" and "death" refer to the spiritual state in the World to Come. That the terms "righteous" and "wicked" do not refer to what is commonly called "good" and "bad" deeds; instead, the measure of good and bad deeds is unknown to us and is unexpected. The third approach says that "life" and "death" mean that the lifespan is expanded or shortened. Another approach is that "righteous" is a person whose merits outweigh his evil deeds.
Notwithstanding, one who does not insist on his rights, and drops the entire matter when being offended - such a person deserves that in judgment, his bad deeds are also dropped. What is the source for that? "He (God) pardons transgression and overlooks sin." The Talmud reads this as follows: "Whose transgression does He pardon? - One who overlooks sins committed against himself."
Art: Still life with three books by Van Gogh