There are two types of occasions of sin: remote and near (or "proximate"). An occasion of sin is remote if the danger it poses is very slight. For instance, if someone knows that he tends, once he starts drinking, to drink to the point of drunkenness, but he has no problem refraining from ordering the first drink, having dinner in a restaurant where alcohol is served might be a remote occasion of sin. We don't have to avoid remote occasions of sin unless we think that may become something more.
An occasion of sin is near if the danger is "certain and probable." To use the same example, if the person who has trouble controlling his drinking is going to dinner with someone who always buys him a drink and bullies him into drinking more, then the very same restaurant that serves alcohol might become a near occasion of sin. (Indeed, the bullying person can be a near occasion of sin as well.)
Perhaps the best way to think of near occasions of sin is to treat them as the moral equivalent of physical dangers. Just as we know we should stay alert when we're walking through a bad part of town at night, we need to be aware of the moral threats around us. We need to be honest about our own weaknesses and actively avoid situations in which we're likely to give in to them.
In fact, repeatedly refusing to avoid the near occasion of sin can be a sin itself. We aren't allowed deliberately to put our soul in peril. If a parent forbids a child from walking on top of a high stone wall, for fear that he might hurt himself, yet the child does so anyway, the child has sinned, even if he doesn't hurt himself. We should treat near occasions of sin in the same way.
Just as the person on a diet is likely to avoid the all-you-can-eat buffet, the Christian needs to avoid circumstances in which he knows he is likely to sin.