The backdrop of this Psalm of David is the rebellion of his son and betrayal of his friend. It is a low moment of life when friends and family become enemies.
In the betraying friend described in verses 12-14, it is hard not to see Judas. Jesus was also hurt by a friend. David's betrayer (Ahithophel) and Judas both hanged themselves.
Whatever your present trial, call upon God (v.16), pray continually (v.17), and cast your burden upon Him (v.22). He will sustain you!
In the New Testament, Peter said is like this: "Casting all your care upon him; for he careth for you." (1Pe 5:7 KJV)