It is just confusing that the teachings of the Catholic church teach us that through sins (original sin committed by Adam and Eve) there comes death. Jesus died. Does it mean He had sinned?
No, Jesus did not sin. He did, however, die for the sins of the world, including mine and yours and everyone else's.
The Bible puts it this way:
Jesus was (and is) just. We, on the other hand, are unjust. The just one, Jesus, took the place of the unjust, us, and He endured the punishment we so justly deserved.
Mind you, there was nothing just about Jesus' arrest, conviction, and death sentence. In the plan and purpose of God, however, His death proceeded according to the plan He and His Father and the Spirit devised before the foundation of the world.
That plan involved providing a way of escape for sinners whom God loves, so they could spend eternity with Him in heaven. To be allowed into God's heaven, however, one has to be sinless. Through the death of His Son Jesus, God graciously, mercifully, and lovingly imputed Jesus' righteousness to us while at the same imputing our sins to Him. Paul puts it this way,
One sin, one act of disobedience, makes us unrighteous in God's sight. On the other hand, one act of obedience on Jesus' part made it possible for us to become IN JESUS the righteousness of God. What a miracle! Jesus obediently submitted to a death He did not deserve so that our justly-deserved death sentence could be commuted. Our pardon for sin was signed in blood, the blood of God's Lamb, Jesus, who took away the sin of the world (see John 1:29 and 36).
In other words, by imputing our unrighteousness to Jesus on the cross, God made it possible for Jesus' righteousness to be imputed to us.
The result of this "double imputation" is that you and I can be justified in God's sight if we simply put our faith in Jesus, believing in our hearts that He died FOR US. Think of being "justified" in God's sight as being "declared righteous" in God's sight.
God, however, does not force on us His gifts of forgiveness and eternal life. That is why we must individually cry out to Him in faith to save us. When we simply take Him at His word, believing that He forgives us and welcomes us into His forever family, we are then assured He will do as He promised.
Scripture is clear about whether Jesus sinned:
Therefore, since we have a great high priest who has ascended into heaven, Jesus the Son of God, let us hold firmly to the faith we profess. For we do not have a high priest who is unable to empathize with our weaknesses, but we have one who has been tempted in every way, just as we are - yet he did not sin. (Hebrews 4:14-15)
The Catholic church errs when they teach that anyone dies for original sin. The entire 18th chapter of Ezekiel covers this idea: The one who sins is the one who will die. (v 20). Nobody died for Adam's sin but Adam.
Good question. Your asking about how the ransom works, and how we are paid up on sin's debt upon death.
Jesus' death was unjust, literally, influencing the scales in terms of divine law. Hence he paid a fee though not in debt.
To be metaphorical -
Its the get out of jail free card! You still have a dollar.
So yes, Jesus died without sin, which was the whole point of the ransom which results in our saving via a debt being paid off (the debt of sin, which by the way is far more expensive than $1)