This article is part of Tools of the Trade, a weekly series in which a variety of experts share actionable tips for achieving fast and effective results on everything from forming good habits to raising money.

This week Red Hat CEO Jim Whitehurst explains why it’s important to apologize to employees after a screw up.

The number of corporate apologies has increased dramatically over the past decade. And for good reason: Failing to admit a mistake is one of the fastest ways a CEO can put themselves and their company’s reputation at risk. I’m not alone on this – 81 percent of Americans say a public apology from a CEO would be seen as a positive step during a crisis.

And yet, too many leaders still struggle to publicly acknowledge when they stumble. A 2013 study by Forum Corporation found that of the nearly 1,000 global leaders and employees surveyed, only 19% of employees said their bosses were willing to apologize for mistakes.

I understand the reluctance, to an extent. As chief executive, you are responsible for your business, your customers, and your employees — the stakes can be high, which can make looking failure in the face very scary. I’ve met leaders afraid to acknowledge mistakes for fear of letting others down or showing a “crack” in their armor.

Unfortunately, that’s the wrong approach. An important part of a leader’s job is to build trust and loyalty among employees by communicating openly and taking ownership of mistakes. When leaders can’t be transparent about their own shortcomings, they risk negatively impacting corporate productivity, bottom lines, and the next generation of talent.

In the decades old film, She Wore a Yellow Ribbon, John Wayne matter-of-factually stated: “Never apologize and never explain.” In the years that followed, we’ve witnessed companies and executives who have ignored that advice and gotten it right. For example, Mary Barra’s thoughtful apology on behalf of GM during their recall, and Tim Cook, apologizing for Apple Maps both come to mind.

Lucky for leaders, accountability is a learnable skill.

I’m speaking from experience. As the CEO of Red Hat, I’ve made and been a part of countless of strategic decisions. Many have been right, but, of course, I’ve made mistakes too. There’s one in particular that stands out. Not necessarily because the decision, but because it taught me the value of admitting a mistake.

In 2008, we acquired Qumranet, an enterprise software company that offered a desktop virtualization platform. While we believed that buying the company would give us valuable real estate in the virtualization market, key components of their technology were not open source. We estimated that it would take at least six months to rewrite the code so we could open source it

Red Hat had just spent $100 million to buy a company in a white-hot, quickly evolving sector — and to open source the code would take six months to a year. After deliberation, we decided to go to market with the proprietary code, confident our associates could work in tandem to rewrite it as an open source solution.

It was the wrong decision. There were more challenges than we’d anticipated. Most pressingly, we had to rewrite the code before we released it again, which resulted in a delay of a year-and-a-half instead of six months.

It was a headache. But it was also a lesson. After acknowledging to both the company and board that we’d made a mistake, I explained why we’d made the decision. Providing this context, I realized, had multiple positive effects.

I didn’t set out to highlight this decision. But when my board asked about the slowness of our progress, I was transparent as to why. When asked about it by associates, I was open about why we made the decision and why I now realized it was wrong. I didn’t go into it trying to make it an example, but I found that being open and transparent helped build trust and credibility.

For leaders who need to apologize to employees, no matter how great or small the transgression, I recommend the following three-step approach:

Be transparent: Honesty is the best policy. A lack of transparency is the nail in the coffin in your role as leader if you do not provide employees with a 360-degree view of the matter at hand. Describe everything from the opportunity, the decision-making process and most importantly, where you, as their leader, went wrong. I cannot stress enough the importance of taking ownership for your mistake and actually saying the words, “I’m sorry.”

Be open: More specifically, be open to feedback – even harsh criticism. Part of being a CEO means growing a thick skin, which means being able to take what your staff throws at you (within reason). They might be angry and in many cases, rightfully so. Don’t just listen to what they are saying — try to actually understand their concerns. One good way to do this: issue an open door office hour, where employees can come and discuss concerns one-on-one. Distribute your email widely and encourage staff to reach out with their thoughts. Alternatively, set up a question box where employees can submit comments anonymously.

Be proactive: Too many leaders consider listening to be a passive exercise. Getting to the core of your employees’ frustrations means 1. Asking the right questions (such as, “How do you feel about the method we used to share the news with the staff?”) and, 2. Providing tangible solutions (for example, suggesting sharing major decisions via a company-wide email, so everyone is kept in the loop.)

As a leader, you want to avoid mistakes whenever possible. But part of your job is taking responsibility when you do inevitably mess up.