Jesus was sent by God to pay the price for our sins, for all the wrong we have ever done. But on the night before He was to be crucified, Jesus looked at what He was being asked to do for us and began to feel troubled. Jesus knew the emotional, mental, and physical pain He was about to endure and so He prayed to the Father, asking that the Father let this cup of death pass Him by. In the same situation, any one of us may have thought, "Why should I do this for them after all they have done?" But Jesus said, "Let it be done, not according to My will, but according to Yours, Father." (Mark 14:36)
Being God Himself, Jesus knew all the wrong, all the sins, that each and every one of us would commit. He knew the bad decisions we would make. He knew all of our weaknesses and our failures. And yet, He willingly gave His life for us. Despite our weaknesses and our ungodliness, Jesus died for us (Romans 5:6). Despite the fact that we were sinners, Jesus went to the cross and paid the price for our sins (Romans 5:8).
The divine part of Jesus looked past all of our sins, weaknesses, and failures. He looked at what His sacrifice would accomplish, our salvation. And, because He loves us, His heart was filled with joy, a joy that enabled the human part of Him to walk that road to Calvary and endure the pain and torment of the cross (Hebrews 12:2). That joy gave Jesus the strength to say, "Not my will, but Yours be done."