Psalm 27's title says it is By David. It holds two moods side by side: fearless confidence and earnest prayer. It opens with two questions that expect the answer no one: Yahweh is my light and my salvation. Whom shall I fear? Yahweh is the strength of my life. Of whom shall I be afraid? When evildoers came against him, they stumbled and fell. Though an army should encamp against me, my heart shall not fear.
At the center is David's single desire: One thing I have asked of Yahweh, that I will seek after: that I may dwell in Yahweh's house all the days of my life, to see Yahweh's beauty, and to inquire in his temple. His greatest longing is not safety but God himself. Yet safety follows, since in the day of trouble God will keep him secretly in his pavilion and lift him up on a rock.
The second half sounds different. David pleads, Hear, Yahweh, when I cry with my voice. He recalls God's invitation and his reply: When you said, Seek my face, my heart said to you, I will seek your face, Yahweh. He asks God not to hide his face, and he trusts that even if his father and mother forsake him, Yahweh will take him up. False witnesses rise against him, but he is confident: I will see the goodness of Yahweh in the land of the living. The final verse speaks to the reader: Wait for Yahweh. Be strong, and let your heart take courage. Yes, wait for Yahweh.