1 Samuel 30:6 KJV And David was greatly distressed; for the people spake of stoning him, because the soul of all the people was grieved, every man for his sons and for his daughters: but *David encouraged himself in the Lord his God*[emphasis mine].
Life is such that nobody can be there for you all the time. Even the best of men can turn their back on you if it suits their own interest. The ability to encourage yourself is very vital. Instead of focusing on being disappointed when humans act like humans, you can encourage yourself in the Lord your God. He is the only One who will never leave or forsake you.