"He [Jesus] knew what was going to be involved on the cross; he knew he was being made sin for mankind. He knew that when God would lay on him the sins of us all, it would mean a terrible moment of separation from the face of God. He knew all that, and as he said later on in the garden of Gethsemane, his soul was 'exceeding sorrowful' (Matthew 26:38); nevertheless he turned aside to comfort these unhappy followers of his [John 14:1ff]. He was more concerned about their unhappiness than his own immediate problem, and thus we have this wonderful view that on the very eve of the cross, our Lord gave himself freely in comfort and consolation to others.
"How typical and characteristic of him! He did the same thing on the cross itself, you remember, even after they had driven the cruel nails into his hands and his feet. There, dying on the cross, he had time to speak to that thief dying by his side. Bearing in his own body the sins of the world, he had sufficient compassion and love and sympathy and understanding to turn to the wretched man who was there being crucified with him."
(--Martyn Lloyd-Jones, Let Not Your Heart Be Troubled)