All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
A Muslim who sees an evil is obliged to change it according to his ability and according to the stages that are determined by the Sharee’ah, the least of which is to reject the evil in one’s heart and this requires not socializing with evildoers when they are doing the evil. For more benefit, please refer to Fataawa 92398 and 1048.
If one has to socialize with those people because of work circumstances, then he should be equipped with religious knowledge by which he can repel the misconceptions which he may encounter. For more benefit, refer to Fatwa 21363.
Allaah Knows best.