The story of Joseph in Potiphar’s house is a well-known example of how to resist temptation. Joseph’s refusal of Potiphar’s wife shows his loyalty to both his earthly master and his heavenly master (Gen 39:8–9). In some ways, his actions can be compared to the two greatest commandments (Matt 22:37–40). In resisting temptation, Joseph showed his love for God as well as his love for his “neighbor,” Potiphar. We find a literal example of Paul’s admonishment to “flee from sexual immorality” (1 Cor 6:18) in Joseph, who flees when Potiphar’s wife persists.
Genesis 39 also provides an example of how to deal with trials. It would have been easy for Joseph to be discouraged. He had been sold into slavery by his own family, and as soon as things started going well for him again, he was falsely accused and thrown into prison. But throughout these trails, Joseph did not complain. Instead, he remained faithful to God.
Joseph’s story is a practical example of someone who perseveres through trials. At this point in his life, it seems that everything has gone wrong. His brothers sold him to slave traders. After achieving some success as a slave in Egypt, he was falsely accused of attempted rape—in revenge for his honest behavior—and thrown into prison. Now, when it seems like he might have a chance to be freed (Gen 40:14–15), the chief cupbearer forgets him, condemning him to two more years in prison (Gen 40:23–41:1).
The text does not tell us how Joseph responded to these circumstances. His actions seem to be the actions of a man who trusts God. Looking back on his life, he will acknowledge that “God meant it for good” (Gen 50:20). The apostle Peter tells his readers that it “is a gracious thing when … one endures sorrows while suffering unjustly” (1 Pet 2:19 ESV). Joseph, who was imprisoned under false accusations, suffered unjustly. Yet God remained with him through all his trials (Gen 39:2, 21, 23), and Joseph remained dedicated to God (Gen 40:8; 41:16).