The Dharma teaches that the manifestation of a consequence requires the confluence of multiple causes and conditions. Wrong views, afflicted emotions (attachment, aversion, and indifference), and the habits and tendencies that impel us to act in ways that are unskillful or undesirable constitute the fundamental causes of unbeneficial actions. The conditions that favor such conducts include material circumstances, similarly-inclined company, and situations.
If we desire to avoid those habitual tendencies, it is essential that we avoid conducive conditions for its manifestation. A well-known example is that of a person with alcoholic tendencies, who must avoid proximity and access to alcohol (material circumstances), persons with similar conducts (company), and those events in which this behavior is normative (situations).
We can successfully apply this strategy to all unskillful tendencies, identifying and avoiding the triggers that favor the repetition of any conduct we may wish to eliminate.