Delight thyself also in the Lord and he shall give thee the desires of thine heart. Psalm 37:4
Hebrew poetry is interesting in that it uses restatement not rhyme or rhythm to make emphasis. Applying that to verse 4 we learn that the second portion of this verse, “and he shall give thee the desires of thine heart” is a kind of restatement of the former portion.
How does this work? As we delight in our God He gives us what we delight in - more of Himself!
So the second portion is not saying that if we love God we will get what we like. But rather that as we love him he becomes more and more precious to us and we are blessed by more of that very precious Lord Himself!
Such is the mysterious ways of our Lord! May we delight in him first that our every hope lies within Him and our trust is entirely in His hands.