In Acts 4:25 and beyond, the Bible lets us know that David understood the will of God. He was able to see into the future, and know God's plans and what was to happen concerning Jesus. This made His prayer life more effective.
It is important to know the will of God before praying. God's will is contained in His Word. Spend time in the Word of God before praying so that you pray out the will of God.