Even though David was king, he saw himself as a stranger and sojourner in this life. His psalm is a meditation on the brevity and vanity of life and the need for God’s help and perspective to make meaning of it all. On top of this, he is aware not only of his own frailty, but of his own sin, and the sense that God is disciplining him for it. He cried out that God would hear him and that he would hear from God.
Life is hard enough without feeling that God is against you. When we feel this way, we can cry out as David did. Pray out your hurts and fears. Be honest. God knows. God hears. God answers.