Temptation is a test of a person's ability to choose good instead of evil. It is an enticement to sin and follow Satan instead of God. Part of the experience of this life is to learn to overcome temptation and to choose right over wrong. Modern revelation indicates that Satan does not have power to tempt little children until they begin to be accountable for their actions (see D&C 29:47).
Since the Fall of Adam and Eve, people have had an inclination to follow earthly desires and to succumb to appetites and passions. This life was given as a time in which God's children could learn to use their agency to overcome temptation and to choose of their own free will to follow Jesus Christ.
The last days in which we live are especially "perilous times" (2 Timothy 3:1). The influence of the adversary is widespread and seductive. Satan tries to deceive and to make sin seem appealing. But each individual can defeat Satan and overcome temptation. Each individual has the gift of agency—the power to choose good over evil. Those who humble themselves before God and pray continually for strength will not be "tempted above that which [they] can bear" (Alma 13:28). As they willingly obey the commandments, Heavenly Father strengthens them to withstand temptation.
The following principles also help:
Centering one's life on the Savior. The prophet Helaman counseled his sons, "Remember, remember that it is upon the rock of our Redeemer, who is Christ, the Son of God, that ye must build your foundation; that when the devil shall send forth his mighty winds, yea, his shafts in the whirlwind, yea, when all his hail and his mighty storm shall beat upon you, it shall have no power over you to drag you down to the gulf of misery and endless wo, because of the rock upon which ye are built, which is a sure foundation, a foundation whereon if men build they cannot fall" (Helaman 5:12).
Praying for strength. When the resurrected Savior came to the Nephites, He taught the multitude: "Ye must watch and pray always lest ye enter into temptation; for Satan desireth to have you, that he may sift you as wheat. Therefore ye must always pray unto the Father in my name" (3 Nephi 18:18–19). In the latter days He has given similar counsel: "Pray always, that you may come off conqueror; yea, that you may conquer Satan, and that you may escape the hands of the servants of Satan that do uphold his work" (D&C 10:5).
Studying the scriptures daily. Nephi taught, "Whoso would hearken unto the word of God, and would hold fast unto it, they would never perish; neither could the temptations and the fiery darts of the adversary overpower them unto blindness, to lead them away to destruction" (1 Nephi 15:24; see also Helaman 3:29–30).
Filling one's life with goodness. When life is filled with goodness, no room is left to do evil.
Avoiding tempting places and situations. Places or situations where temptations are likely to come should be avoided. Inappropriate material in magazines, books, television, movies, and music and on the Internet should also be avoided.
Striving to influence others for good. Latter-day disciples of Jesus Christ can be in the world but "not of the world" (see John 17:14–18). They can strive to influence others to live good and wholesome lives by setting a righteous example, being a good friend, participating in community service, and, as appropriate, letting their voices be heard in defense of moral values.
Never hesitating in decisions to withstand temptation. The Savior "suffered temptations but gave no heed unto them" (D&C 20:22). When Satan tempted Jesus in the wilderness, the Lord never wavered. His answer was quick and firm: "Get thee behind me, Satan" (Luke 4:8). James counseled: "Resist the devil, and he will flee from you. Draw nigh to God, and he will draw nigh to you" (James 4:7–8).
—See True to the Faith (2004), 174–76
"Live in Obedience"
Joseph B. Wirthlin, Ensign, May 1994, 39–42
Willing obedience provides lasting protection against Satan's alluring and tantalizing temptations.
"Searching the Scriptures: How to Face Temptation"
Robert J. Matthews, Ensign, Aug. 1973, 68–69
How should we deal with temptation? Avoid it, resist it, and pray for help from God, through the grace of Christ, to overcome it.
"Four Heavenly Helps"
Charles W. Dahlquist II, New Era, Aug. 2005, 44–47
As we face temptations and challenges, we are not left alone. Our Heavenly Father has given us many things to help us to overcome those temptations that would draw us down.
"Stay on the High Road"
Gordon B. Hinckley, Liahona, May 2004, 112–15; or Ensign, May 2004, 112–15
I plead with you to never let down, to establish a purpose and hold to the line and move forward undeterred by any opposing temptation or force that may cross your path.
"Prepare to Resist Temptation"
Liahona, July 2003, 25; or Ensign, July 2003, 71
How can an eternal perspective help us resist temptation? How can we prepare ourselves to resist temptation?
"You Can't Pet a Rattlesnake"
David E. Sorensen, Liahona, July 2001, 48–50; or Ensign, May 2001, 41–42
Resisting the temptations of today's electronic media is not easy. It takes focused courage and effort.
Rulon G. Craven, Ensign, May 1996, 76–77
Your greatest protection against temptation is an active and vibrant testimony of the gospel of Jesus Christ, which binds us to our Heavenly Father.
Guide to the Scriptures
"Withstanding the Evils of the World"
The Latter-day Saint Woman, Part B, Lesson 14
"Developing and Teaching Self-Mastery"
Duties and Blessings of the Priesthood: Part B, Lesson 18
Teachings of Presidents of the Church: David O. McKay, Chapter 9