I learnt the hard way. When I kept lots of money on me, I used to end up spending it as quick as I got it. When I have to go to the ATM I reconsider whether I really have to buy that thing or not.
I always have a tenner stashed away for emergencies. I am a geek I know