Whoever gets sense loves his own soul; he who keeps understanding will discover good.
Proverbs 19:8 ESV

If you love your life, you will cultivate logical, clear thinking. I think "sense" and "wisdom" are a poor translation of Hebrew leb. "Sense" is closer, but it's really referring to the ability to think. Studying philosophy and practicing logic are ways to cultivate leb.

Once you have understanding, you have to guard it by putting it to use and guarding against irrational thought processes. If you do this, you will "discover good" because you will continually discover new truths by observing and analyzing the world around you.