Quick answer
His own mouth is the trap. The righteous man in the second line is not spared trouble; he comes out the other side of it.
Read both lines
The snare image has run through this book since 6:2, where a man was caught by the words of his own mouth, and the mechanism is the same: nothing outside him set this. The second line is the one worth reading slowly, because it does not promise exemption. It says the righteous comes through, which assumes the trouble happened. That is the honest shape of this book's claim, and it is a different thing from the promise of a life without difficulty that these verses are sometimes made to offer.
Related: Proverbs 6:2 · Proverbs 12:21 · Proverbs 24:16
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.