You are asking about Psalm 1 from the Hebrew Bible Book of Psalms (RSV):
Blessed is the man who walks not in the counsel of the wicked,
nor stands in the way of sinners, nor sits in the seat of scoffers;
but his delight is in the law of the LORD,
and on his law he meditates day and night.
He is like a tree planted by streams of water,
that yields its fruit in its season, and its leaf does not wither.
In all that he does, he prospers.
The wicked are not so,
but are like chaff which the wind drives away.
Therefore the wicked will not stand in the judgment,
nor sinners in the congregations of the righteous;
for the LORD knows the ways of the righteous,
but the way of the wicked will perish.
It seems to me that this is a kind of basic "How It Works" for all of us, as spiritual beings trying to negotiate our way through human challenges. The word translated as "blessed" more accurately means "How happy!", and this psalm is a brief guide to living a happy life. "The law of the LORD" is the basic energy of life, the Power of God expressing through us and around us. If we meditate—stay centered—on that energy, life will work for us, easily and joyfully.
If, on the other hand, we fall into error thought—choosing beliefs and actions that are not consistent with the law of the LORD—our path through life will be challenging and often painful. Further, the psalm reminds us that only the law of the LORD is constant and eternal. Anything inconsistent with that law will perish—forcing us to continue making new choices until those choices do, in fact, become consistent with the Presence and Power of God expressing in and through us as divine law.