David wrote this song as a prayer. He communicates with God and is amazed by God’s knowledge and comforting presence. He is also moved by how much God loves Him and how was uniquely created by God. David ends the psalm with an honest and earnest prayer where He invites the LORD to examine his heart.