If Jesus is God, then who did He pray to?
This is a very common question and the answer is found in understanding the Trinity and the incarnation of Jesus.
The Trinity is the doctrine that there is only one God in all existence. This one God exists as three persons: The Father, The Son, and the Holy Spirit. They are not three gods, but one God. Each is a separate person, yet each of them is, in essence, divine in nature.
A close analogy of the Trinity can be found by looking at the concept of time. Time is past, present, and future. There are three "aspects" or "parts" of time. This does not mean that there are three "times," but only one. Each is separate, in a sense, yet each shares the same nature, or essence. In a similar way, the Trinity is three separate persons who share the same nature.
The doctrine of the incarnation in Christian teaching is that Jesus, who is the second person of the Trinity, added to himself human nature and became a man.
The Bible says that Jesus is God in flesh, "In the beginning was the Word, and the Word was with God, and the Word was God.....and the word became flesh and dwelt among us" (John 1:1, 14); and, "For in Him all the fullness of Deity dwells in bodily form" (Col. 2:9). Jesus, therefore, has two natures. He is both God and man.
Jesus is completely human, but He also has a divine nature.
He is worshiped (Matt. 2:2,11; 14:33; 28:9)
He worshiped the Father (John 17)
As a man, Jesus needed to pray. When He was praying he was not praying to Himself, but to God the Father.