Jesus endured His suffering on the cross by thinking about the joy His sacrifice would bring: humanity's salvation

Hebrews 12:2

Looking unto Jesus the author and finisher of our faith; who for the joy that was set before him endured the cross, despising the shame, and is set down at the right hand of the throne of God.

from Jesus Is My Joy list