He went to earth to be crucified. He didn't go to earth just because. Our God, his father sent him to the earth to save all our sins. Jesus could've chose not to be crucified, but he loved us so he sacrificed himself for us. He rose from the dead 3 days later.
He left all his Godly qualities in heaven, the reason he knew was that God told him and because it was God's will that he come here and die for us so that we would be set free, and Jesus knew the will of God better than anyone.
Just through his duality he knew everything. His supernatural divinity part. Crucifixion was the Roman method of execution. They did not invent it, they did perfect it though that would enable a person to suffer a long time and not die right away, from blood loss or suffocation.
Well, he was filled with Gods Spirit upon baptism. He knew the scriptures from childhood, so much so the elders revered his knowledge & wisdom. I believe The Holy Spirit would have revealed all truth unto him. Plus he would have followed the Spirits leading. He'd heard numerous times, from heaven (an audible voice) that he was the Son of God. & remember he was in heaven before earth.
He had a direct line to God because he was part of and One with God. He always knew his ultimate purpose - at least from adulthood on. When it was time to know the details God told him/let him know/understand what would occure.
He could have Flamed everybody involved and gone back to a Empire with Street of Gold, No He Stayed on the Cross for you and I, For all of the Sins of the World. He Truly is the Son of God forever we will be with Jesus Christ Lord and Savior. Amen.
From His closest disciple John, who quoted Jesus as saying, "For this reason the Father loves me, because I lay down my life that I may take it up again."
And Matthew, another disciple wrote: "From that time Jesus began to show his disciples that he must go to Jerusalem and suffer many things from the elders and chief priests and scribes, and be killed, and on the third day be raised."
And Mark, a friend of the disciple Peter, wrote: "And he began to teach them that the Son of Man must suffer many things and be rejected by the elders and the chief priests and the scribes and be killed, and after three days rise again.
And Luke, the doctor, wrote of Jesus predicting His death on several occasions. Of course, Jesus knew Who He was and why He came--to die for the sins of the world and be raised to life. "No one takes it from me, but I lay it down of my own accord. I have authority to lay it down, and I have authority to take it up again. This charge I have received from my Father."