One Old Testament example that comes to mind is Joseph, the son of Jacob. Joseph had some bad experiences as a teenager and young adult. He was sold by his own brothers as a slave into Egypt (Gen. 37). He ended up in Potiphar's house; Potiphar was an officer of Pharaoh and the captain of the guard (Gen. 39:1). Joseph was Potiphar's slave, and Potiphar saw that the LORD was with Joseph. As a result, Potiphar gave Joseph much authority in his house.
As time passed, Potiphar's wife cast longing eyes at Joseph and pursued him vigorously. The text says that she spoke to him day by day. She was persistent in her efforts to get him to have sexual relations with her. However, what did he do? He refused her advances repeatedly. Many men would have gladly entertained her desires, but not Joseph. Even though Potiphar trusted Joseph and probably would have never found out, Joseph refused to mess around with another man's wife.
He told her that he could not commit this wickedness because it would be a sin against God! Joseph was right; in the final analysis, all sin is against God! Yes, even though Potiphar might not have found out if Joseph had committed adultery with his wife, God would know, and Joseph knew it was wrong! Potiphar's wife tried to influence Joseph to do that which is wrong, but he didn't do it! She exerted some pressure on him, but he didn't give in (even when she essentially tore his clothes off). He said "no" to sin and did his best to keep his distance from that immoral woman (Gen. 39:10-13). There's certainly a lesson for us on this point today: "Evil companionships corrupt good morals" (I Cor. 15:33, ASV). Joseph tried to stay away from the evil peer pressure of this woman. He tried to avoid her wicked influence because he did not want to sin! We should do the same. When our companions, whoever they might be, encourage us to do things we know are wrong, we should avoid those companions! They are not our friends! No one is a true friend if they encourage us to sin.
Perhaps you are wondering: Well, what happens if we don't avoid evil companions? What happens if we continue to hang around them and let them exert pressure on us to act in a sinful way? The answer is quite simple. Sooner or later, we'll give in to the sin. We will examine this general situation tomorrow.