Have you ever had to escape danger by going out a window? Paul escaped from Damascus that way (Acts 9), and David through a window as well (I Sam. 19). One day David went home and discovered that he was being spied on. His wife let him down through a window, and he escaped from his enemies. As we read this psalm, we notice four assurances that kept David going.
First, David knows that God sees, so he prays (vv. 1-5). David needed to be defended and delivered. His enemies were lying about him. Suffering is hard to take when you haven't sinned. But God is on the throne and is watching us. He knows our difficulties. The next time you're in trouble, remember that God sees you. Pray to Him--He's listening.
Second, David is sure that God hears, so he waits (vv. 6-9). While we wait, God accomplishes many things, and we regain our strength (v. 9; Isa. 40:31).
Third, David is sure that God rules, so he trusts (vv. 10-13). God meets David with mercy and the enemy with judgment. David prays that God will scatter his enemies, stop them and consume them.
Fourth, David is sure that God delivers, so he sings (vv. 14-17). We cannot always stop people's actions. David's wife warned him that he had to leave or he would be dead by morning (I Sam. 19:11), yet he was able to sing about God's mercy in the morning (v. 16). Always thank God after He answers prayer.