Sometimes we think that God will leave us alone at the most difficult time we have, but it is not so because God is always around us to take care of us, to strengthen us.
God will not abandon us, but He sometimes allows difficulty in our lives to teach us that we will not be safe if we are far from Him, and through these difficulties we can know the Lord more.
I have set the Lord always before me: because he is at my right hand, I shall not be moved.
David did not give up despite the trials that he were going through, but he kept going forward, he knew that God had not left him alone at any time. The psalmist David was a man who believed in God to the fullest, he knew that the Lord did not leave him alone at any time.