Psalm 31:13–14 (ESV) … “For I hear the whispering of many— terror on every side!— as they scheme together against me, as they plot to take my life. But I trust in you, O Lord; I say, “You are my God.”
Assassination was a quick and handy way to get rid of him and clear the throne for Absalom or for another of his sons, or even for someone else entirely. The air was full of rumor and plot.
The expression, “fear on every side,” is especially significant. They called David by a nickname: “magor missaviv”—“terror round about.” The expression became a favorite phrase of the great prophet Jeremiah (Jeremiah 6:25; 20:3–4; 46:5). Probably nobody ever suffered so much as he in Old Testament times. Yet even the weeping prophet had to go to David for the fitting phrase to describe his griefs—magor missaviv.
Now David puts himself back in the time of Absalom’s rebellion. The foes are gathering and David sees himself fleeing from Jerusalem with his bodyguard. As he went his heart had been lifted up by prayer and this psalm tells us how he prayed.
David knew where His strength lay, even though his kingdom was in ruins. We note three themes in this part of his prayer. He wants conscious victory: “But I trusted in Thee, O Lord: I said, Thou art my God” (31:14). He calls upon the two appropriate names for God: Jehovah, the God of covenant, and Elohim, the God of creation. His kingdom may have fallen apart but he still had God, whose promise set him on the throne and whose power can set him back there—all circumstances to the contrary notwithstanding.
In spite of this persecution, David’s trust in the Lord was unwavering. He relied on God to deliver him from his enemies. He prayed, My times are in your hands, recognizing that all the events and circumstances of his life were under God’s sovereign control, which is tempered by his unfailing love.
 Phillips, J. (2009). Exploring Psalms 1–88: An Expository Commentary (Vol. 1, Ps 31:13–16). Kregel Publications; WORDsearch Corp.  Lawson, S. (2004). Psalms 1–75 (M. Anders, Ed.; Vol. 11, p. 168). Holman Reference.