If you added “quit smoking” to your New Year’s resolution list, the first step in achieving this goal is to see the change as a process, or series of steps, rather than as a switch that gets flipped.

First, it’s important to recognize that in order to change the smoking/vaping behavior for the long term, the underlying compulsion to inhale nicotine needs to be controlled. This impulse originates in the survival instinct parts of the brain, where nicotine acts like an imposter safety signal. It’s why using nicotine products can help to “relax” us, and why the idea of quitting is often experienced as anxiety, threat, grief or even hopelessness. Too many people try to force themselves to stop thoughts of smoking or vaping, only to eventually exhaust themselves and give in… or give up.

Changing tobacco behavior is a lot like solving a jigsaw puzzle: First build a foundation by setting the edge pieces. You can do this by talking to a health-care provider about support medications that are available to control the compulsion to smoke.

Next, engage with community support services such as group meetings, individual counseling, quit lines or online forums that can help by channeling the collective experience of quitting. I recommend looking for resources that are more individualized to meet your specific needs. And remember, having a loved one or friend who can offer a helping hand in finding just the right puzzle piece is essential to overcoming roadblocks and getting you back on the path toward the end goal.

Finally, recognize that putting the tobacco product down is a big step, but it doesn’t stop there. It will take time to learn how to live your life without nicotine. Most people benefit from extending medication treatments for at least six months, even if they’ve already quit using tobacco. The extra time and support give the brain more time to heal completely from the long-term effects of nicotine exposure, and help people remain smoke-free for a lifetime.

Hiccups can happen sometimes, just as in all other aspects of life, and tobacco can unexpectedly find its way back into your routines. If that happens, don’t give up. Acknowledge what you’ve learned from the experience and get back to solving the puzzle. Qualified health-care professionals can often tease out important details about the relapse and help put this understanding to its best use.

Quitting isn’t about luck or willpower. It doesn’t have to be hard or uncomfortable. Quitting is about strategy, resilience, and the patience to uncover a path forward — one puzzle piece at a time.

Frank T. Leone is a professor of medicine at Perelman School of Medicine at the University of Pennsylvania and director of the Comprehensive Smoking Treatment Program at Penn Medicine.