The trick to not smoking is to not smoke.

Feel like having a smoke? Don't. Thinking "I was good today; I'll just have one"? Don't.

Sounds like I'm oversimplifying but that's how I quit. You can come up with all the little tricks you want but it all boils down to not doing that thing.