
The gospels of Matthew and Mark identify this place of prayer as Gethsemane. … During his agony as he prayed, “His sweat was, as it were, great drops of blood falling down upon the ground” (Luke 22:44). At the conclusion of the narrative, Jesus accepts that the hour has come for him to be betrayed.


https://www.blueletterbible.org/Comm/terasaka_david/misc/crucify.cfm

Jesus knew exactly what would occur. He chose to fulfill His purpose!
Jesus predicted that the Son of Man would be handed over/betrayed to the elders, the chief priests, the scribes, and the teachers of the law. … Jesus also predicted that the Son of Man would be crucified by the Romans/Gentiles. The Hebrew word gentile means non-Jewish people. Again, we repeat Jesus predicted (over and over) that His earthly life would involve suffering/shame/death at the hands of those who opposed Him, and His subsequent exaltation by God in resurrection.
Jesus explicitly identifies the path of suffering and death with the will of God, and which affirm that God was completely in control of the events leading up to, including, and subsequent to the Crucifixion. Strictly speaking, Jesus allowed Himself to be mistreated and executed, because it was the will of God for His life/ministry/death. This is clearly the understanding that Jesus reveals.