The second line is often read as a statement about how a person is saved, which is not what a proverb of this kind is doing.
Quick answer
Money has a limit, and the verse names where it is reached. What actually carries a person through is not what they own.
Read both lines
The first line is doing the work most readers need. Wealth is genuinely useful in this book, and the verse does not deny that; it identifies the one situation where the usefulness runs out, and calls it the day of wrath. The second line then names what does not run out. In its own setting this is Proverbs speaking the way Proverbs speaks: right dealing has a durability that money does not, and the person who lives that way is repeatedly spared what overtakes others. The book has already said the same thing about the wicked falling by his own wickedness.
What it does not mean
This verse is not teaching that a person earns rescue by their own moral performance, and it should not be turned into an account of how anyone is made right with God. Proverbs is a book of observation written inside a covenant, not a doctrine of salvation, and reading verse 4 as a formula puts a weight on the reader that the sentence was never carrying.
From this side of the cross
The verse says righteousness delivers from death, and the gospel's news is about where that righteousness comes from. Paul writes that God "made Him who knew no sin to be sin for us, that we might become the righteousness of God in Him" (2 Corinthians 5:21). The believer is not accumulating a righteousness that might one day prove sufficient. It was given, it is theirs, and the deliverance this proverb describes is not something to be assembled under deadline.
Related: 2 Corinthians 5:21 · Proverbs 10:2 · Proverbs 11:28
New King James Version®, Copyright © 1982, Thomas Nelson. All rights reserved. Full copyright information. Scripture provided by API.Bible.
Go Deeper
If this verse has been used to put weight on you that it was never carrying, ask about it directly.