Keeping away from things that could lead to it,
Ibn al-Qayyim (rahimhaullaah) said:
As for the signs of being serious about keeping away from forbidden things, they are: keeping away from things that could lead to it, and avoiding all means of drawing close to it.
Such as the one who flees from places in which there are images that lead to fitnah (temptation),
– for fear of being tempted by them, and
– giving up things with which there is nothing wrong for fear of things that are wrong, and
– avoiding excessive indulgence in permissible things for fear of falling into that which is makrooh, and
– avoiding people who commit sin openly or regard it as good and
– promote it and take it lightly and do not care about what they do of sin.
For mixing with such people is likely to incur the wrath and anger of Allah, so no one mixes with them except the one whose heart is lacking in respect for Allah and His sacred limits.
[al-Waabil al-Sayyib, Page 32]