1I WILL extol You, O Lord, for You have lifted me up and have not let my foes rejoice over me. 2O Lord my God, I cried to You and You have healed me. 3O Lord, You have brought my life up from Sheol (the place of the dead); You have kept me alive, that I should not go down to the pit (the grave). 4Sing to the Lord, O you saints of His, and give thanks at the remembrance of His holy name. AMP
This Psalm is a "Psalm of David". What is David doing here? He is praising the LORD for what He HAS DONE! This is how David "encouraged himself in the LORD"! Remind yourself of all that the Lord has done for you and those you love. Then when you face adversity, you will NOT faint and give up because you will remember, and then expect the God of the Bible to come through for you again! And then you can say, with David, verses 11-12:
11You have turned my mourning into dancing for me; You have put off my sackcloth and girded me with gladness, 12To the end that my tongue and my heart and everything glorious within me may sing praise to You and not be silent. O Lord my God, I will give thanks to You forever. AMP
Shalom in Him!