This psalm has always been one of my favorites. I have shared similar thoughts. It was written by Asaph a worship leader in the temple. There are several psalms that carry his authorship, and this is one of them.
It begins by asserting that God is good to Israel and to those whose motives are pure (reading in the NET version). He quickly puts himself in a predicament by saying he almost went the wrong way. Why? He envied the proud, the evil people who prosper materially, those who don’t suffer like the rest, the arrogant, the violent, the ones that mock and do evil. They act like they have God’s power and even mock him. This really gets him to the point when he says, “Surely in vain I have kept my motives pure and maintained a pure lifestyle”. (v. 13) He sees no point in living a righteous life. Asaph tries to make sense of all of this, but it is just troublesome for him.
As a Christian I can identify with Asaph. Many times, I have had the same thoughts. I see what happens in this world and understand what he is talking about. Asaph almost comes to the point of saying that it isn’t worth being godly, in other words give up being a God follower. We’ve seen many Christians who have decided they no longer want to follow Jesus when things get difficult.
How does Asaph come to terms with this? He goes to God’s temple, and it is there that he realizes evil people have a hopeless destiny. God will ruin them. They eventually will be judged by Him. Now he feels bad about what he has said and realizes he has been like “senseless as an animal” (v. 22).
What helps him move forward? He understands that God is with him all the time. He holds him (v. 23), guides him with wise advice (v. 24) and will lead him to a “position of honor” (v. 24) He tells God he is everything for him. There is no one he desires more than Him here on earth (v. 23). He finishes the psalm saying that even if he loses his physical strength or his heart grows weak God will protect his heart and give him stability. In verse 28 he says, “God’s presence is all I need. I have made the Sovereign Lord my shelter, as I declare all the things you have done.”
Things can get difficult for us for the same reasons as Asaph or due to something else. It can be when we are lonely, friendless, depressed, and had had it with all the injustice we see around us. We can follow his advice and realize we have God’s presence. He realized this as he entered God’s temple. For us, it when we are worshipping with other believers. Hence the importance of assembling with them regularly. God’s presence isn’t symbolic or limited to a place. The Holy Spirit lives in us. He guides and gives us the best advice. No matter what happens to us physically or how we feel in our hearts, God will protect us and give us the stability we need. We need to pray to Him and like Asaph tell him “On earth there is no one I desire but you”. The time will come when God will give us a position of honor in his kingdom. Till then, we hold on to Him and declare to others all the things he has done.
 Psalm 50, Psalms 73-83.
 This could refer to prosperity on earth or in eternity.