It pays to read in context.
The End of the Wicked Contrasted with That of the Righteous.Psalms 7 31 Surely God is good to Israel, To those who are pure in heart! 2 But as for me, my feet came close to stumbling, My steps had almost slipped. 3 For I was envious of the arrogant As I saw the prosperity of the wicked. 4 For there are no pains in their death, And their body is fat. 5 They are not in trouble as other men, Nor are they plagued like mankind. 6 Therefore pride is their necklace ; The garment of violence covers them. 7 Their eye bulges from fatness ; The imaginations of their heart run riot. 8 They mock and wickedly speak of oppression ; They speak from on high. 9 They have set their mouth against the heavens, And their tongue parades through the earth. 10 Therefore his people return to this place, And waters of abundance are drunk by them. 11 They say, "How does God know ? And is there knowledge with the Most High ?" 12 Behold, these are the wicked ; And always at ease, they have increased in wealth. 13 Surely in vain I have kept my heart pure And washed my hands in innocence ; 14 For I have been stricken all day long And chastened every morning. 15 If I had said, "I will speak thus," Behold, I would have betrayed the generation of Your children. 16 When I pondered to understand this, It was troublesome in my sight 17 Until I came into the sanctuary of God ; Then I perceived their end. 18 Surely You set them in slippery places ; You cast them down to destruction. 19 How they are destroyed in a moment ! They are utterly swept away by sudden terrors ! 20 Like a dream when one awakes, O Lord, when aroused, You will despise their form. 21 When my heart was embittered And I was pierced within, 22 Then I was senseless and ignorant ; I was like a beast before You. 23 Nevertheless I am continually with You; You have taken hold of my right hand. 24 With Your counsel You will guide me, And afterward receive me to glory. 25 Whom have I in heaven but You? And besides You, I desire nothing on earth. 26 My flesh and my heart may fail, But God is the strength of my heart and my portion forever. 27 For, behold, those who are far from You will perish ; You have destroyed all those who are unfaithful to You. 28 But as for me, the nearness of God is my good ; I have made the Lord GOD my refuge, That I may tell of all Your works.