It is very depressing to think that Our Lord felt rejected by His Father - but He didn't!
He was quoting the first line of Psalm 22, and might have recited the whole thing if He had the breath and strength.* He wasn't despairing; He was telling us not to despair.
Verses 6-8 and 14-18 prophesy the Passion. Praise begins with v. 23, and salvation is foretold after that, especially in the last two verses.
To the choirmaster: according to The Hind of the Dawn. A Psalm of David.
1 My God, my God, why hast thou forsaken me?
Why art thou so far from helping me, from the words of my groaning?
2 O my God, I cry by day, but thou dost not answer;
and by night, but find no rest.
3 Yet thou art holy,
enthroned on the praises of Israel.
4 In thee our fathers trusted;
they trusted, and thou didst deliver them.
5 To thee they cried, and were saved;
in thee they trusted, and were not disappointed.
6 But I am a worm, and no man;
scorned by men, and despised by the people.
7 All who see me mock at me,
they make mouths at me, they wag their heads;
8 "He committed his cause to the LORD; let him deliver him,
let him rescue him, for he delights in him!"
9 Yet thou art he who took me from the womb;
thou didst keep me safe upon my mother's breasts.
10 Upon thee was I cast from my birth,
and since my mother bore me thou hast been my God.
11 Be not far from me,
for trouble is near
and there is none to help.
12 Many bulls encompass me,
strong bulls of Bashan surround me;
13 they open wide their mouths at me,
like a ravening and roaring lion.
14 I am poured out like water,
and all my bones are out of joint;
my heart is like wax,
it is melted within my breast;
15 my strength is dried up like a potsherd,
and my tongue cleaves to my jaws;
thou dost lay me in the dust of death.
16 Yea, dogs are round about me;
a company of evildoers encircle me;
they have pierced my hands and feet --
17 I can count all my bones --
they stare and gloat over me;
18 they divide my garments among them,
and for my raiment they cast lots.
19 But thou, O LORD, be not far off!
O thou my help, hasten to my aid!
20 Deliver my soul from the sword,
my life from the power of the dog!
21 Save me from the mouth of the lion,
my afflicted soul from the horns of the wild oxen!
22 I will tell of thy name to my brethren;
in the midst of the congregation I will praise thee:
23 You who fear the LORD, praise him!
all you sons of Jacob, glorify him,
and stand in awe of him, all you sons of Israel!
24 For he has not despised or abhorred
the affliction of the afflicted;
and he has not hid his face from him,
but has heard, when he cried to him.
25 From thee comes my praise in the great congregation;
my vows I will pay before those who fear him.
26 The afflicted shall eat and be satisfied;
those who seek him shall praise the LORD!
May your hearts live for ever!
27 All the ends of the earth shall remember
and turn to the LORD;
and all the families of the nations
shall worship before him.
28 For dominion belongs to the LORD,
and he rules over the nations.
29 Yea, to him shall all the proud of the earth bow down;
before him shall bow all who go down to the dust,
and he who cannot keep himself alive.
30 Posterity shall serve him;
men shall tell of the Lord to the coming generation,
31 and proclaim his deliverance to a people yet unborn,
that he has wrought it.
Psalms 22:1-31 (RSV)
*Hanging by His hands compressed His lungs; the only way for Him to take a good breath was to heave Himself up on the spike through His feet.