Although He was God, Jesus experienced human limitations like we do. Not only was He hungry, not only was He sleepy, not only was He weary and lonely, but He also was tempted. Jesus felt the presence and pressure of temptation just as we do. He didn't have a sinful nature, but He experienced temptation.
Now why is it important for us to be aware of the fact that Jesus was tempted? It was so we could know that we follow a God who understands what we're going through. As the Apostle Paul wrote, "In all things He had to be made like His brethren, that He might be a merciful and faithful High Priest in things pertaining to God, to make propitiation for the sins of the people" (Hebrews 2:17).
Jesus also left us an example to follow as we face temptation. He occupied ground that we, too, can occupy. It's important to note that Jesus did not meet Satan with His considerable supernatural power. He could have said, "I don't want to fool around with you right now. I have other things to do." And He could have disappeared. He could have called on the angels to intervene. He could have even overruled Satan because of His clear authority over him. Instead, He met the devil with the written Word. He countered every temptation with Scripture (see Luke 4:1–13).
So when you are tempted, you, too, need to have Scripture stored in your mind and heart to deflect the blows of the devil. When you have memorized Scripture, when you have gotten it ingrained in your memory banks, it is there to use through times of temptation.