He had an awareness for the purpose of His temptations and why He had to go through them. But for this purpose I came to this hour. This awareness allowed Him to still have confidence and hope despite the struggles that were occurring within Him. His awareness of the purpose for His temptations, and understanding why He had to go through them was a source of strength for Him that enabled Him to overcome all the temptations that He had to encounter. Likewise, we will have to go though times of temptation to become more receptive of the Lord's presence and guidance in our lives.
Temptations are inevitable.
They simply cannot be avoided. I did not come to bring peace but a sword. There will be times in our lives that our faith in the Lord will be threatened and put to the test. Yet, there can be a certain optimism even in these difficult times of uncertainty. Like the Lord, if we have an understanding of why it is necessary to go through these difficult times, that knowledge can enable us to endure the temptations and even have victory over them.