I've only recently started commuting by bike to work - approx 20 miles a day.
I still have a car but rarely use it now, except every couple of weeks where I drop off 2 weeks supply of shirts at work.
For me, I find if I set the alarm and get up as soon as it goes off, go through the routine of getting ready and out onto my bike, I never get the urge to use the car instead.
The key thing for me is getting up as soon as the alarm goes off. No snoozing for 10 mins etc.that is a recipe for disaster (which I spent years doing!)