Honestly? Practice. I started by stepping outside and breathing, waiting for the rage to subside. I read about how to get my point across politely and assertively, and practiced in the mirror, in my head, any time I had any point to make.
If I knew I was going to go into a situation that would ordinarily make me lose it, I prepared. I came up with scripts and followed them as best I could. Sometimes, I'd say "I don't want to lose my temper so I'm going to go to my room and calm down." (Or outside, whatever)
I thought a lot about the damage my temper did, how I lost friends, how my relationship with mum was up and down etc.
Some of it is simply deciding that I Will Not Lose My Temper. Sometimes it's barely contained, but I find asking "is this worth it?" Helps. I'm a much nicer person now I'm not so angry, I think, and I find if I don't shout and scream, they don't shout and scream either.
This doesn't mean I don't get angry- it means I am angry, but totally in control.
I slipped a lot. Like I said, it's taken the best part of a decade, from about 15 to now, to see a wall covered in marker and not have a red mist moment.
Sorry if that's really stilted, I'm on my phone. Hope it helps a bit.