I can understand your dilemma about giving up addictions like caffeine and sugar. Caffeine is definitely easier than sugar, but I try to dose them low personally. Like a light roast coffee once a day or something sugary at one sitting a day. Perhaps don't deny yourself sugar, but lower the dose or limit the amount of intake. Your mind will weaken if you deny yourself things and you may break and overindulge. This should be a controlled lowering until desire and cravings diminish. When you can look at something you used to enjoy and NOT have a true craving is when you've conquered the addiction.
I used to have a lot of alcohol in college, but the cravings went away slowly over time. It's cause the body is used to feeling a certain way and when something is missing, then it tends to weaken the self-control mechanisms. Rather than self-control, it's best to mitigate cravings by lowering the dose or limiting intake to a certain time. That way, you taper off instead of cold turkey quit. Some people can quit bad habits cold turkey, everyone's different.
Don't beat yourself up at quiting anything, simply reduce it over time until you can say "I don't need this nutritionless substance any more!" Feed the body first nutritious foods, then cave a little to the cravings. Nutrition first, addictions last.