The simplest way I know to work your way up to it is to begin thinking before you smoke.
The next step is challenging yourself to wait a little longer between smokes. You don't deny yourself, you are simply making yourself more aware.
Working up to it enables your mind to let go because you can't help but be inspired that you have some control before you've even quit. You will notice less trips to the store and money in your wallet. When you realize this you will have proven that you don't have to smoke just because it crosses your mind.
There is no time limit to get to this place. I took 4 weeks and set my quit date the day I knew I was buying my last pack which was 4 days before I quit.
This is just an example of how to get into the mindset you need to quit successfully without struggling to get there.
Have a great Sunday!