Take a step back. Deep breath. Slowly inhale, hold it for about four seconds, very slowly exhale. Helps with many things including anger, anxiety, stress, just feeling overwhelmed in general.
Recognize that it's okay to be frustrated and angry. What's not okay is to let it consume you and have it be a reason for hurting people.
Allow yourself to feel it, but not feed it. Let it settle without engaging.
I suppose that's the hard part. To help with that:
Observe. Try, but don't push yourself, to disengage. If you find that you're forcing it and that ends up frustrating you more, start again. It's okay to not get it quickly. It's actually pretty normal for it to take a while. Brain also likes to fight you sometimes. Don't bother fighting back. You won't win and it only gives it more power. So we go back, take some more deep breaths, slow exhales, and continue.
Identify the cause of the issue and that's where you immediately drop it. If it's physical and you don't really have a place to sort of retreat to, this can be difficult and I don't have a good answer. If it's online or something, and I know it's "easier said than done", just exit the window. Nope out of the application. Allow yourself time to collect yourself.
Realize that it's probably out of your control (very few things that people get angry about are really their fault or something they can control).
Identify what is in your control. Consider engaging in that instead, particularly if it's something that brings you joy. This will allow you to not necessarily replace it, exactly, but to give something else more power.
Remember that everything passes. Nothing is permanent. Think of it as a storm in the sky. Storms come and go, but they are not the sky eternal. Storms are wrath and rage, but they subside, much like anger (and most negative emotions).
A nice quick verbal reminder might be "the clouds are not the sky". Or the old "this too shall pass".
Alternatively: embrace the chaos and use it in a productive (or even dumb but not hurting anybody) way. This is situation-dependent and works differently for different people. Some get it out with writing, some with art, some with music, some with physical activity (again, no active harm, unless it's sanctioned like boxing or martial arts something), some with games that allow you to just go crazy and let it all out. Lots of other stuff I haven't listed here, but hobbies are good.
Maybe also see a therapist who specializes in CBT if this is a constant thing that affects your daily life.
Source: lifetime of bipolar disorder (among other things) which looooooves to suddenly throw me into easily being annoyed or frustrated when the hypomania hits.
Luckily, I'm asocial enough that I'm able to peace out of the outside world, which is something I really need to remember when giving advice like this, because a lot of shit that works for me is impractical for a lot of people.
I was born with a very simple emotional spectrum. I basicly only feel primitive emotions like anger, fear, anxiety, lust, fulfilment and their absence. My serotonin levels are very low and boosting it with meds makes no difference. I hold this as my expertice on the matter. Anger and anxiety rule my reality.
To the point. Emotions have physical and mental component. One can't live without the other. Be aware of this and the fact that you can be unwillingly feeding them, with thougts you run in your head.
To kill an emotion you clear your head till the physical component subsides. After that you need a little mental discipline, not to reignite it. It doesn't happen in a second, so plenty of time to catch yourself in the act.
The idea that emotions are energy that needs to be vented is bs.
Try this: handwrite your negative thoughts out. Then try to prove to yourself why the feeling isn't true. Again, write that out. Now tear up the paper and get rid of it. Don't keep a journal of it.
You would be stunned how much this helps. I got this technique from a doctor who wrote a book about living with what he calls neuropathic disorder (in my case chronic pain). In the book he describes how we can easily make ourhealth worse through negative thoughts. It's very possible for bad feelings to cause physical pain because the two share the same neural pathways, so it's critically important not to let your emotions get the better of you.
The book is called Back In Control (the author is a back surgeon). It's a good read for anyone with chronic illnesses, or even just for those who want to explore how to better control their emotions and live healthier.
Are we talking the occasional getting really annoyed, or an almost every day thing?
If occasional, you really just either need to remove yourself from the situation or find something to ease yourself back down. If it's jerks in the road for example, maybe try a different route. It may be longer, but less stressful. It just let then hold onto the anger. Just because they're unhappy and being rude, just nice side and let them go on. Don't let then make their problem yours.
If we're talking every day, you need to find the core of that if you want to feel better. I got help after 20 years of never being able to let go of my emotional damage. It would just keep adding up like an unbearable weight on me. I went to the doctor and finally just spoke up about it. Now for about $5/mo, I don't have that burden to bare anymore. I didn't really have huge issues, I just had some chemical issues that needed a nudge and now I can deal with the everyday crap without it crushing me.
My SO had more severe issues that got them arrested and they totally lost control and would forget days on end and such due to untreated bipolar disorder. After being voluntarily committed, life got back on track and they'll be graduating college soon due a good career. It still takes regular therapist visits and a DBT support group, but it keeps everything working properly now.
If you need help, don't be afraid. I felt for years I could get help, but that pills would make me a zombie. I found something that works for me though, and it feels amazing. I've lost so many friends and special people and opportunities because I was mad or antisocial for nothing.
This ran longer than intended. Hopefully your issues aren't of the every day variety, but if they are, know you have options.
I threw something once and it bounced off a sofa (which was my target to avoid damage) and it hit someone I cared about--that was the last time I used throwing as my outlet for frustration. Now I just sigh loudly, take a deep breath, and try the counting thing others have said. Good luck and if you feel stuck, it's ok to talk to a professional. It's better than hurting someone or yourself.