I quit smoking in May last year. This time it worked, because I was way better prepared. Let me explain, maybe it helps someone else as well.
I realized for me smoking was about 3 things:
1 the mechanism of nicotine addiction,
2 the habit and
3 the need to pauze for a minute to either feel satisfied or happy, or to just think for a minute.
Those 3 things made up my smoking habits. Understanding them made it easy to quit.
1 Nicotine is very addictive, so that's a bit of a willpower thing. The good news is that it only takes 1 to 3 weeks to get rid of that physical addiction. Hang in there for a little while and that's fixed! Always remind yourself that it's not smoking that you want, but the feeling it gives and that even more often you just did light one up out of habit only.
2 habits can be replaced... But only if you're aware of them. Many times I felt like I "needed" a cigarette, but after the first weeks when the physical addiction wears off, I knew that I just wanted my habits to continue. The reasons are number 3, you need a pauze sometimes, a moment to step back and reflect. That's not a bad habit, but filling that habit with cigarettes is!
3 instead of cigarettes, people replace the smoking habit with for example chewing gum, or sweets (hmm chocolate!!!). But then you create a new addiction... So by being aware that you sometimes need a break you can just start to take them consciously, whenever you feel like smoking! Just realizing: "ah, my mind tells me that I need a moment", helped me a lot to bend that feeling of needing a cigarette away to consciously take a short break instead.
Then finally during the first months I made a new routine to help me cope by allowing rewards to stay part of my daily routine, but only once a day. I would reward myself with a cup of chocolate icecream at the end of every day. Just to not lose that occasional moment of satisfaction every day. At some point I didn't need that any longer and it faded into the background and I started to forget buying the icecream.
After the first weeks I have never wanted a cigarette anymore. I broke the mental connection between smoking and taking a short moment away from what I was doing.