The sapiential books like Proverbs, Psalms, or Wisdom, attributed to David and Solomon differ markedly in their didactic style from the Pentateuch attributed to Moses. The moral code of man is synthesized in the Pentateuch with the ten commandments (Exodus 20), but the moral of the sapiential books start from the teaching of Psalm 1, the Psalm of the two paths: "For the LORD watches over the way of the righteous, but the way of the wicked leads to destruction" Psalm 1:6.
According to sapiential books happiness is not an end of man, as explains the greek philosophy with Aristotle and Plato, but a return of our interaction with the ethical laws of the universe, this is how the book of Proverbs teaches this ethical concept: "The wages of the righteous is life, but the earnings of the wicked are sin and death" Proverbs 10:16.
These teachings are in the old testament the starting point of the beatitudes of Jesus in the Sermon on the Mount (Matthew 5:3-13, Luke 6:20-26). If we are edifying, progressive, and benevolent we receive blessings; on the other hand, if we are chaotic, unjust, involutive, and destructive, we receive a curse according to the Bible. Two mentalities, two paths, two rewards. The spiritual gift of righteousness or golden rule: "Do unto others as you would have them do unto you" Matthew 7:12; as the book of proverbs explains, it leads us to that life full of joy, happiness, peace, and longevity. This is the life that takes into account our neighbor and ourselves, the life that is worth living. Those who lead a righteous life are called "sons of God". On the other hand, if we sin our goal is death, ruin, and destruction because we are practicing the error: "For they sow the wind, and they shall reap the whirlwind." Hosea 8:7. When we keep all this in mind is when we have wisdom to live, and without wisdom, no one can progress or prosper. Wisdom not only teaches, but also gives life, that is, blesses.