In the Old Testament in Numbers 22-24 we read the story of Balaam. The Bible suggests that he had a true knowledge of God and was susceptible to revelation from Him.( From the LDS Institute Manual) He received revelation, he had some form of the priesthood in his life. He was able to communicate with Heavenly Father. He seemed like a good righteous person or he would not have received these gifts.
Then he encounters Balak. Balak is worried because there are so many Israelites right on his doorstep. So he sends some people to entice Balaam to come visit so he can curse Israel for him. At first Balaam refuses, so Balak sends different people who would be more appealing to Balaam. Balaam decided to go, against the advice of Heavenly Father. On his way there the donkey he is riding sees an angel blocking their path and tries over and over again to turn away. Enraged Balaam begins to beast his donkey until the voice of the Lord comes to him from the Donkey rebuking him. Now Balaam still goes and tells himself he will only do good and not do what Balak asks him. Balak continues to try to get Balaam to do what he wants by offering riches and powers. Balaam keeps stringing Balak along trying to get both the power and riches and keep his faith. Finally Balaam told Balak that “God would only bless Israel when they were righteous. If the Moabites could seduce Israel into idol worship, they would lose God’s power.” ( From the LDS Institute Manual) He did this so he could tell himself that he was not betraying his fatih but still doing what he could to keep what Balak offered him.
How many times do we justify the things we do? We tell ourselves of this won’t matter, we are living by the exactness of the law not the spirit of the law. We have to make a choice what our focus and work will be for. For good and Heavenly Father or power and material things.
Here are a few link to talks from General Conference of the Church of Jesus Christ of Latter Day Saints about peer pressure and making good choices.
https://www.lds.org/general-conference/1996/04/spiritual-shepherds?lang=eng
https://www.lds.org/general-conference/1993/04/some-lessons-i-learned-as-a-boy?lang=eng