Joseph did not merely resist the harmful influences of Egyptian society. Nor did he timorously live in hermit-like seclusion to avoid being adversely influenced. Quite the contrary: he exerted a powerful and beneficial influence on the Egyptians, as we clearly see in this week's Torah reading.
Many people live, like Joseph, exposed to harmful influences. Some resist the bad influences and remain unaffected by them. Their resistance to change may come about as a result of three different attitudes:
Holding Firm: One may strain and struggle to hold firm to his beliefs, and resist the environment. But such resistance to change is far from perfect. Before encountering this environment there was not the slightest possibility or even potential for change in one's moral conduct, one's spiritual standards. But now the person has undergone a descent, for it is obvious that the harmful influences of his surroundings could affect him and likely would affect him but for his continuous resistance.
Aloofness: Another individual may separate himself from society and maintain his own lofty Torah standards in seclusion. But this, too, is not the perfect approach. His imperviousness to change rests solely upon his lack of exposure to his surroundings. If he were to mingle with society, possibly he would be influenced by it. Again, the potential for change exists.
Turning the Tables: The third and best approach to resist the evil influences of the environment is when the individual works in and on society to change it and elevate it to his own level. It is he who then affects his environment. This is the perfect approach, for if one has the strength to upgrade the standards of his society, no influence can bring him down from his spiritual plane.