Have you ever received an email from a client, customer or coworker that was rude, irrational, demanding and unnecessary? Or had an employee make a costly mistake? Your first instinct may have been to react immediately — to angrily hit “reply” or chide your employee in front of the entire office.

Keeping your cool, especially during stressful situations, is one of the most important attributes of a good leader. These five tips will help you keep a clear head and an even temper, no matter how stressful your day.

1. Take a step back. Try to view the situation as a third party. Pretend you’re a representative of yourself and evaluate the problem from a logical point of view. An emotional reaction or angry tirade will almost never solve a dilemma. At best, losing your temper may cause an embarrassing situation and you may need to offer an apology for your behavior. At worst, you’ll intensify the situation and add to the list of consequences. Ask yourself, “Is this something I’ll still be angry about a year from now?” If not, let it go and move on. Many seasoned entrepreneurs will tell you that the things that used to upset them don’t even register on their radar anymore.

Related: 8 Little Ways to Become a More Well-Rounded Person

2. Be the voice of reason. When someone raises his or her voice to you, take a deep breath and remain calm. Keep your voice steady and speak at a normal pace. Most people will quickly realize they’re the only aggressor in the situation and will bring their voice and their temper back down. Some may even apologize for their outburst. At the same time, be prepared to apologize if you say something you didn't mean to say.

3. Think carefully before you speak. Once something comes out of your mouth, you can’t take it back. Saying hurtful or nasty things can be risky or dangerous to your professional reputation. It can also shatter your credibility. Watch what you say, how you say it, and where you say it. It’s best to confront someone in private, whenever possible.

Related: 6 Ways to Improve Your Conversations

4. Don’t take it personally. Entrepreneurs care deeply about their business and take extreme pride in their products and services. After all, they created the entire company from the ground up. Because of the emotion tied to your business, you may take negative feedback from customers as a personal attack. Instead, try to put yourself in your customers' shoes. You never know what kind of personal stressors someone may be dealing with on a daily basis. Try to practice patience and understanding and always treat everyone with the same level of respect you’d like to be shown.

5. Walk away. If you find a situation pushes you to your breaking point, step away until you can return with a clear mind. If you’re in the middle of an argument, simply tell the other person that you feel the conversation has gotten out of hand and you’d like to table the conversation for another time. Take time to calm down. Go outside and take a walk or take an hour and go to the gym. A break from the office and physical activity will help you relax. When you return to the problem, your fresh perspective will help you find the best solution.

Related: The 3 Qualities of Likable People