First, you have to decide that you really want to quit. Examine your life, consider what's going on, and ask yourself if this is a good time to quit. If you are in a crisis, this may not be the best time.
Keep a smoking diary to figure out your triggers. Think about what was going on right before you lit up. What were you just thinking about or feeling? What were others around you doing right before you smoked?
When you are ready to quit, you'll want to do your best to make sure you avoid—or are keenly aware of—the things that trigger you to smoke. Arrange your life so you avoid those triggers for up to three months.