Why did Jesus have to suffer?
Hebrews 5:8 though He was a Son, yet He learned obedience by the things which He suffered. 9 And having been perfected, He became the author of eternal salvation to all who obey Him,
We know that Jesus was always, without fail, obedient to his Father. John 8:29
From this, the only way that I can understand what the writer to the Hebrews is saying is that Jesus learned the cost of obedience by the things which he suffered. This was necessary to equip him to be a high priest for us, as the writer has explained in Hebrews 2:18 and Hebrews 4:15
The temptation was not just to sin, it was also to use the supernatural power he possessed to escape crucifixion. Jesus therefore understands what it can cost us to be obedient to God’s commandments.
The Apostle Paul (who I believe to be the writer to the Hebrews) experienced the cost far more than we will ever be called upon to experience. 2 Corinthians 11:24-28
The sufferings of Jesus are described in Psalm 22:1-21 and in Isaiah 53:1-11
Jesus endured all for our sake and as our example; he exhorts us to take up our cross daily and follow him. Luke 9:23
I hope you find this helpful.
God bless,
Glenn