Great question, and the answer is not only complicated, but it turns out to be a real shocker!
As you know, Yeshua is the Son, the "arm" of YHWH (Yahweh) (Isaiah 53:1); He is not the Father - but He is YHWH in the Flesh, a Manifestation of YHWH. When He cried out from the stake on that fateful day, He was talking as a son to his father. We must remember that GOD cannot be born or die! But His Son's body was human, prone to all the pains and illnesses of this fallen world.
God simply is and always was, and when He sent His "Son" Yeshua to be our Final SIN Sacrifice, He was actually sending a part of Himself - a human vessel with a divine Nature. It is that Divine Nature inside Yeshua that lived on after His human body was killed. In other words, Yeshua basically "put a face" on God to explain YHWH to mankind from a more personal level; while Yeshua was NOT the Father, He was an "arm" or extension of YHWH.
Yeshua was "God in the Flesh" only because He had His Father's Divine Nature, which is how He was able to be perfect enough to be our Final Sin Sacrifice. But He never came to replace the Father in any way.
The "Trinity" espoused by Catholicism and many Christian denominations is a myth. There is no such thing. You won't find the word "trinity" anywhere in the Bible, yet many insist "God is three Persons!" Hardly anyone stops to think that the Scriptures amply show that YHWH is ONE (Deuteronomy 4:35, 6:4, 32:39; Isaiah 45:18, Mark 12:29, James 2:19, etc.). He is Echad - Hebrew for the plural form of one (as in one BUNCH of grapes, or one DOZEN eggs as opposed to one grape or one egg).
Nowhere do we find that He was "three persons in one" which is an absolutely ridiculous concept. First of all, YHWH is a SPIRIT as is His Ruach (Holy Spirit). Neither of them have human bodies and cannot therefore be "persons." Yeshua, however, was an actual Person who walked the Earth - a Person with a divine Nature! Please think about this: If the Holy Spirit was a "person" then how could he possibly get inside each believer?
God can present Himself to us in whatever form He wishes and we have no right to suggest He is anything except what Scripture has revealed. (Please read our article which debunks "trinity" and reveals why it is an erroneous concept.) People tend to forget that YHWH has also revealed Himself as a burning bush, pillars of cloud and fire, three men at the Oaks of Mamre, and He even spoke through a donkey before before we ever learned about Yeshua and His atoning death.
Now here is a real kicker: Yeshua never said, "Why have you forsaken me?" He said, "Why have you spared me?" These words are straight from Anrew Gabriel Roth's Aramaic English New Testament (AENT) which is a translation of the oldest NT ever discovered, the Khabouris Codex which was written in all Aramaic - no Greek in sight! Here's the scripture along with its footnote from the AENT:
Matthew 27: 46. And about the ninth hour, Y’shua cried out with a loud voice and said, My El! My El! [Lemana shabakthani] Why have you spared me?
Footnote for the above: Y’shua was not necessarily quoting Psalm 22, although the imagery of the Psalm is certainly intended by Matthew. Greek is transliterated Eli, Eli lama sabacthani, but Peshitta and Psalm 22 read: Eli, Eli lama azbatani. Many Bibles read "forsaken" from which came a false teaching that the Father left Y’shua destitute (Marcionite thinking). Isaiah 53:4 indicates that "we" reckoned him smitten of Elohim, but it is not YHWH who tortured His own son, but men motivated by religious tradition. Psalm 22 references those who scorned Y’shua for his Faith in YHWH and called him a worm (detested), but Father YHWH does not forsake the righteous, nor does He at any time "forsake" His own Son – see Psalm 9:9, 10; 37:25; 71:11; Isaiah 49:14-16.
Y'shua says "Eli" (my El). He is in great physical pain after being brutally tortured; those around him were confused about whether he was saying "Eli-yah" or "Eliyahu". If Hebrew eyewitnesses were not sure of what he was saying, it shouldn’t be a surprise that Greek transliteration was also wrong, putting "lama sabacthani" rather than "lemana shabakthani". Perhaps the reason Y’shua says "why are you sparing me" is because he has proven his commitment by laying down his life and has already endured about six hours of the execution! So, it’s not a matter of being "forsaken" but that he literally means, "Father, I'm ready, why can’t we finish this?" In a matter of moments from saying this, he dies, which fully supports this interpretation.
Below is an appendix in the AENT that further explains this concept:
My El! My El! Why have you spared me?
Perhaps no Scripture evokes more emotion than the cry from the stake in Matthew 27:46. How is it possible that these powerful words have been misunderstood for nearly two millennia? For many, Y’shua’s last utterance was either understood as a cry of desperation or a declaration of his Messiahship from Psalm 22:1; "My El, My El, why have you forsaken me." Greek versions attempt to transliterate the Psalm as Eli, Eli lama sabacthani. However, the Aramaic Peshitta NT reads: "Eli, Eli lemana shabakthani," while Hebrew Psalm reads: "Eli, Eli lama azbatani." Greek transliteration reflects the Aramaic word as does the Peshitta. However, there is a key difference between azbatani, which only means "to forsake" and its Aramaic counterpart shabakthani which has multiple meanings but also includes the same concept.
Even so, does this mean Y’shua is quoting Psalm 22? To answer that question, consider these verses: "And from that time onwards, Y’shua began to make known to his disciples that he must go to Urislim and suffer much from the elders and from the chief priests, and scribes. And he would be killed, and on the third day would rise up" (Matthew 16:21). "Behold, we are going up to Urishlim, and the Son of Man will be delivered to the chief priests and to the scribes. And they will condemn him to death. And they will deliver him to the Gentiles, and they will mock him, and they will beat him, and they will execute him on a stake. And he will rise on the third day" (Matthew 20:18-19). When Peter prepared to fight Y’shua replied, "...don’t you think that I am able to ask my Father to raise up twelve legions of Messengers? How then could the Scriptures be fulfilled. Thus say that it must be" (Matthew 26:53-54).
Y’shua informed his disciples that his death was inevitable, and that it would be fulfilled according to Scripture. Anyone who tried to prevent his death, even a loyal disciple like Peter, was referred to as being of haSatan! Y’shua knows that he is laying down his life as a voluntary offering according to John 10:11-18, but he can also take it back. He is referred to as the "lamb of Elohim" because the lamb submits his life unto death; a key requirement of Mashiyach according to Isaiah 53:7. Therefore, when Y’shua is suffering on the stake, he is fulfilling the very reason he came into the world – the suffering he could end in the blink of an eye, according to John 10. In this context then, with full power in him, the blessings of the Father, and YHWH’s Messengers with him, he could not have, even for an instant, been forsaken! When Y’shua was praying in the garden just before being betrayed, his prayer was immediately answered by YHWH sending a Messenger, in Luke 22:43, "...a Messenger appeared to him from Heaven to strengthen him."
This being the case, we must look at the final words that come out of Y’shua’s mouth; so let’s examine the Aramaic word shbakthani. As mentioned above, it shares the "forsake" meaning with the Hebrew word used in Psalm 22. However, the root of the word shbak has several other meanings including: (1) reserve (2) keep (3) spare (4) forgive. In Luke 23:34, Y’shua uses the exact same word to say, "Father, shbak (forgive) them for they know not what they do." This multiplicity of meaning in Aramaic, naturally groups related concepts under the umbrella of the same word. In this case, reserve, keep and spare all are variations from the same concept of setting aside. The same can be said idiomatically of forgive, where offenses are metaphorically also "set aside." Conversely, the rabbis throughout the centuries have always translated the Hebrew azbatani in Psalm 22 exclusively as "forsaken." That is not to say the other meanings of shbak do not exist also in its Hebrew equivalent, because they do in other verses of Scripture. In the end only one solution reveals itself, which is that another meaning of shbakthani is intended. The context safely eliminates forgive as a possibility as it makes no sense; therefore, the highly similar concepts of reserve, keep or spare are left to investigate.
Some scholars have suggested that lemana could be interpreted as a statement and that would allow the first two definitions as possibilities with readings like, "My El, my El, for this you have reserved/kept me." However, traditional understanding of this verse has always affirmed lemana only as a question. Therefore, what remains as the most viable reading is: "My El, my El, why have you reserved/kept/spared me." While all these possibilities will clearly work, the choice of Paul Younan (a foremost Aramaic scholar) is the wording, "why have you spared me" because reserve or kept has a connotation of a wider question that Y’shua is clearly not asking. Furthermore and in concordance with the other Scriptures mentioned, Y’shua is clearly aware of the reasons for his death, and therefore to use the other options would allow for inadequate options like, "why have you kept me around" or "why have you reserved me for this purpose." Since he fully knows the reasons for his suffering, the preferred choice is "why have you spared me" or, "I’ve been here for six hours and will die for this cause, but how much more time will this take?" In response to this question Scripture tells us that Y’shua dies shortly thereafter, thus validating the context.
Finally, there is very good reason why tradition has been so strong on linking this utterance to Psalm 22. While Y’shua himself may or may not be quoting the Psalm, the rest of the narrative is clearly referencing it. This section of Matthew is a Midrash, or dramatic story rendering, of Psalm 22. The very rebukes found in the Psalm are on the lips of the Pharisees as they taunt Mashiyach (Psalm 22:6-8; Matthew 27:39-40). The Psalm references his "hands and feet pierced" and having "enemies gamble for his clothing" (Psalm 22:16, 18; Matthew 27:34). Even the probable condition of Y’shua hanging on a stake is described with phrases like, "I am poured out like water and all my bones are out of joint. My heart has turned to wax and has melted away within me. My strength is dried up like a potsherd and my tongue sticks to the roof of my mouth. You lay me in the dust of death." With all this Psalmic imagery, it’s no wonder many have concluded with apparent logic that Y’shua is quoting Psalm 22:1! But we must also consider other factors; for instance: Y’shua was also experiencing brutal physical trauma, which is known to cause impairment of speech. Secondly, we do not have concise evidence to know whether Y’shua was speaking Hebrew or Aramaic at that moment, so even in the best of circumstances those who stood by listening may not have clearly heard what he was saying. In this matter, Hebrew speaking witnesses at the site of the execution thought he was calling on "Eliyah" as opposed to "My El." Perhaps it was only an exhalation of pain (Eli-ah). Altogether these criteria present a compelling case for determining how two similar phrases were transposed. In the end what we have here is another section of Matthew which "represents" rather than "quotes" from Scripture.