Consider this verse: "Hear me when I call, O God of my righteousness!" (Psalm 4:1). David is calling God to hear him and listen to him—to take David's desires, needs and safety under consideration. He is in deep trouble and needs help now!
I never was in war, so I can't share from personal experience. But I know Robert's story. He was one of three young men in a foxhole in Korea. Not far from them was an enemy foxhole, with another three young men in it.
A grenade was thrown from that foxhole, and landed near Robert's foxhole. Suddenly his two fellow soldiers were dead, Robert's lungs were pierced with shrapnel and the enemy was coming to finish the job. Despite his injuries, he had to continue fighting for his life. Eventually he won the battle, and began a three-day trek, literally crawling back to his unit.
If Robert had not made it back and received medical care, I could not tell the story. Robert was my father.
Many of us have heard this phrase: "There are no atheists in foxholes." God knows what goes on in foxholes, the urgent prayers of both sides. At this time, though, He is not intervening much in the affairs of this world. The Pharisees were partially correct in what they said: "God does not hear sinners" (John 9:31). It's a completely different story, however, when the sinner is repentant.
David knew this. He often found himself in similar distresses, his life in imminent danger. He urgently prayed to God, just like the men in the foxholes. David knew he needed forgiveness and mercy. He also knew that God would hear, rescue and restore him. David was well aware that he had much to go through, but he was privileged to know how the situations would end. Therefore, he trusted God to work it out.
We can trust, as David did, and these words will echo true in our lives: "I will both lie down in peace, and sleep; for You alone, O L ord , make me dwell in safety" (Psalm 4:8).
We may not be in a literal war, but we all have our foxholes and enemies that we need deliverance from. In those times, we can remember and take comfort in these words: "The L ord will hear when I call to Him" (Psalm 4:3).