First off, what does it mean to fear God?
1 John 4:18 says, "There is no fear in love, but perfect love casts out fear, because fear involves torment. But he who fears has not been made perfect in love."
The fear of the Lord is not the fear that is in this world. To fear God is to give Him reverence, honor, and respect as the Almighty Powerful One.
Proverbs 1:7 says, "The fear of the Lord is the beginning of knowledge,
But fools despise wisdom and instruction."
To fear God is the very beginning of wisdom. Proverbs goes on to say,
"The fear of the Lord is to hate evil;
Pride and arrogance and the evil way
And the perverse mouth I hate."
To fear God is to hate evil. To hate evil is to love God with all our heart, soul, mind, and strength (Matthew 22:37-38). Hate and love are both actions. We should be actively hating evil and loving God.
This is what brings forth the blessings and promises found in Psalm 1.
Psalm 1 promises that all who fear God and meditate on His law will be planted, immovable, and will prosper in all their ways.
This is what David experienced in the story of 1 Samuel 24.