In D&C 59:9-12, the Lord says that the best way to keep ourselves unspotted from the world is by participating in the sacrament every Sunday. The Sabbath day is appointed unto us to "rest from [our] labors, and to pay [our] devotions unto the Most High" (D&C 59:10). We should apply our weekly sacramental covenants to every other day of our lives. Each time we partake of the sacrament, we should repent of our sins and seek to improve our lives.
In John 17:15, Christ tells his disciples, “I pray not that thou shouldest take them out of the world, but that thou shouldest keep them from the evil.” Christ doesn't ask us to stay away from the world, but to stay away from the evils of the world. The point of our coming here to earth is to "mingle with the sons of men, to gain an experience that will bring them back to God; but not to partake of the sins of the world" (Ensign, David O. McKay "Unspotted from the World," August 2009). Christ has overcome the world, and we should follow His example--not by taking ourselves out of the world, but keeping ourselves from evil (see John 16:33).
David O. McKay analyzed these verses and said that we should not "conform to the fashions of the world." We should avoid temptations, which come in multiple forms: "temptation of the appetite; a yielding to the pride and fashion and vanity of those alienated from the things of God; or a gratifying of the passion, or a desire for the riches of the world, or power among men." Temptations may come in the same quiet way that spiritual promptings come. Our decision to respond to those temptations will weaken us, whereas if we choose to actively follow spiritually promptings we will be strengthened immensely. We can train ourselves to respond quickly to those spiritual promptings, avoiding the temptations of the world. Because we choose to act in accordance to God's will, we will be called "a peculiar people"--God's people. We can know that we are living exactly as God wants us to live, and as a result we will be extremely blessed and be an incredible example to others! (Ensign, David O. McKay "Unspotted from the World," August 2009)