Jesus was willingly crucified. He submitted to His captors, even though He was well able to stop them from killing Him.
Jesus did what only He could do. He came into the world as a human being and also as God on a mission that only God could carry out.
In Philippians Chapter 2, verses 4-8, Paul writes: Each of you should look not only to your own interests, but also to the interests of others. Your attitude should be the same as that of Christ Jesus; Who, being in very nature God, did not consider equality with God something to be grasped, but made Himself nothing, taking the very nature of a servant, being made in human likeness. And being found in appearance as a man, He humbled Himself and became obedient to death–even death on a cross! [NIV Bible]
Jesus took the sins of all people onto Himself, and He accepted the punishment for those sins, which was death.
In First John, Chapter 4, verse 9-10, it is written: This is how God showed His love among us; He sent His one and only Son into the world that we might live through Him. This is love: not that we loved God, but that He loved us and sent His Son as an atoning sacrifice for our sins. [NIV Bible]
In Romans Chapter 3, verses 21-25, it says: But now God has shown us a way to be made right with Him without keeping the requirements of the law, as was promised in the writings of Moses and the prophets long ago. We are made right with God by placing our faith in Jesus Christ. And this is true for everyone, no matter who we are. For everyone has sinned; we all fall short of God’s glorious standard. Yet God, with undeserved kindness, declares that we are righteous. He did this through Christ Jesus when He freed us from the penalty of our sins. For God presented Jesus as the sacrifice for sin. People are made right with God when they believe that Jesus sacrificed His life, shedding His blood. [NLT Bible]