A brief overview of the crucifixion - what it was and how it worked in simple terms
Jesus was nailed onto a wooden cross with long nails through His wrists and heel bones. This was done after He had been flogged with a whip and had a 'crown' of long sharp thorns pressed into His head. This was done to cause pain, but also to mock Him for claiming to be the King of Israel. He died on the cross in the most appalling and drawn out agony. But it was all part of God the Father's own plan. Therefore the crucifixion and death of Jesus was not a failure or a diversion from God's plan. It was the plan. Everything happened exactly as God had intended so that we could be saved by Jesus' death:
25And He said to them, "O foolish men and slow of heart to believe in all that the prophets have spoken! 26"Was it not necessary for the Christ to suffer these things and to enter into His glory?"Luke 24:25-26 (NASB)
this Man, delivered over by the predetermined plan and foreknowledge of God, you nailed to a cross by the hands of godless men and put Him to death. Acts 2:23 (NASB)
The key to understanding what happened on the cross is to realise that as Jesus suffered and died He was voluntarily taking upon Himself the punishment that was rightfully due to you, me, and everybody else as a result of our sin. God the Father viewed Him, while He was on the cross, as carrying on His own shoulders the guilt and blame of all the sin of the world. It was put on Him so that it did not have to be laid on us. In fact, our sin was transferred to Jesus. Thus, one man, Jesus Christ, was able to take upon Himself the punishment for the sin of the whole world:
For Christ also died for sins once for all, the righteous for the unrighteous, that he might bring us to God, being put to death in the flesh but made alive in the spirit;1 Peter 3:18 (RSV)
For I delivered to you as of first importance what I also received, that Christ died for our sins in accordance with the scriptures,1 Corinthians 15:3 (RSV)
The reason it was possible for Jesus to take our sins upon Himself and be punished for them instead of us was that He Himself was entirely sinless. He had no sins of His own to be punished for. If Jesus had been a sinner Himself, even to the slightest extent, then His death on the cross would have been what He deserved for His own sin. It would have been the rightful result of a sinful life. Yet, because He was entirely perfect and sinless, His death could not validly be a punishment for His own sin, because He had none. It was possible, therefore, for God to treat His suffering and death on the cross as being endured on behalf of us, i.e. in our place. It was a 'substitutionary' punishment, just like the animals that were sacrificed in the Temple, as we saw in chapter nine.
He himself bore our sins in his body on the tree, that we might die to sin and live to righteousness. By his wounds you have been healed.1 Peter 2:24 (RSV)
A technical word for this transfer of blame to Jesus is that He was punished 'vicariously'. This comes from a Latin word which means 'in place of'. So, Jesus was punished in our place. It is a little bit like the legal concept of 'vicarious liability', where an employer is considered to be to blame for the negligence of his employees. So, if an employee injures someone in the course of their employment, then his employer is considered to be to blame for it in the eyes of the law, even where he had nothing to do with it. The employer then has to pay the damages, even if he himself did nothing wrong.