A combination of things.
As a person, I always look for the most efficient and frictionless way to achieve something, the "path of least resistance", including not feeling like physical or psychological trash (read "instant gratification"). That's a character trait and a character flaw.
Trusting in the methodology and idea that "yes, this feels like shit right now, but countless millions of people get through this stage of withdrawal, and they go on to live great lives where they don't feel like crap anymore and instead feel better than when they smoked". When you're down in that ditch, not just quitting, but because your life is sub-par in various ways, and smoking is something you can rely on to make you feel better, it's hard to just leave it alone, and it's difficult to trust that others are right when you have a cynical outlook on the world and it feels like people frequently misguide you and others, so why would it be any different this time? That's a bad perspective. Apply logic and reasoning. Wrestle with it. Rationality.
People would invite me outside for a smoke over a pint, or after achieving something, or after a difficult conversation. I "rewarded" myself with a cancer stick for doing something on the project management system, all kinds of weird little things you do to justify a smoke "because I achieved x and I should be rewarded for x", but the reality is that you were rewarded for x anyway, and x was kind of fun, that's why you do it in the first place, but your worldview revolves around getting the next nicotine fix.
It isn't even just the nicotine. It's "you" time. It's a ritual. It's time to decompress mentally and not look at a screen, do something with your hands that isn't work-related, and "indulge".
But it's all bollocks. There's nothing positive or of substance in smoking. It's all in the head of the smoker. They're hooked.
Sometimes it has meant avoiding certain situations with some people, e.g., I don't go to the pub, or bars. In fact, I don't drink anymore either. Been sober ~7 years now.
After a year or so of saying "no, I won't fucking do that to myself and to my family", suddenly, you just don't want a drink, you just don't want a cigarette. That's not to say that sometimes in a stressful situation I don't reminisce and go "oh, a cigarette would make me feel so much better right now", of course, that happens, then the fantasy passes, and I'm still at my desk, I haven't given in.
To anyone wanting to quit and is serious; get rid of your lighters, including the neat-looking Zippo you like to fidget with, and all the other paraphernalia. Get rid of your ash trays. Get rid of your rolling papers, filters, rolling machine (if you own one). If you're going to quit, why will you need any of it?
Don't replace it with eating junk food. Don't replace it with a cheeky glass of wine. If you have struggled with one kind of addiction, you will struggle with another. The self-discipline is being honest with yourself and reigning the monkey on your shoulder in.
And don't justify "just one smoke" with because it's a holiday or you're on vacation.