@Dogaredabomb you need to learn skills around impulse control. Maybe there's also self sabotage going on? A therapist can help you.
Caffeine is a drug, you could cut it out. Chocolate (the eating kind, not sure about the drinking kind)/cola/ordinary tea/green tea/decaf coffee - they all have caffeine in them. Maybe you're like an alcoholic with it and can't have "just one". Maybe you need to have none ever.
If you weren't wired from caffeine, then maybe you'd be able to deal with the smoking issue too. Two issues, smoking identity (having something in your hands to fiddle with, smoking breaks, a go-to emotional crutch in stressful times) and addiction to nicotine. Maybe use patches while you deal with the first, then tackle the second.
Got to learn to swap unhealthy behaviour for healthy behaviour. Kindness in words could be a start, eg you're not stupid, you're struggling - so in what way can you help yourself? You wouldn't beat up on a friend who was struggling, so don't do it to yourself.