This has to be one of the best psalms. The psalmist hungers for the Lord even while mockers taunt him that the Lord has abandoned him. He remembers a time when the Lord was near and his hope is that the Lord will again draw near to save.
This psalm is a prayer in which the psalmist is preaching to himself. The psalm is written in the middle of great trouble. It is not a time of peace. It is in the midst of this trouble that he preaches to himself of both the joy of being in the presence of God, and among His people in worship, as well as the hope that the Lord will restore His joy.
This is so much of what it means to preach the Gospel to oneself. It means to remind oneself in the midst of trial of the enduring joy in the Lord and faithfulness of the Lord.