For 40 wilderness days and nights he was tested by the Devil.

Jesus was wandering in the wilderness for 40 days and 40 nights with no food. The Devil tested Jesus 3 times.

1st with bread
2nd with power
3rd with faith

I believe that when you are tempted you should calm your mind, focus and think of something else. (Someone who encourages you). When the Devil tested Jesus, he refuses by quoting sections of Deuteronomy. When Jesus refuses the Devil retreats. This shows that staying strong will never fail.