Comedian Bill Cosby once famously said, “I don’t know the key to success, but the key to failure is trying to please everybody.” This can be especially true when being forced to lead a team, a project, or especially a workforce. You can’t please everybody but hopefully everybody will respect you because respect is the key to success when being a leader. Here are five tips you can put-forth to be a better leader and earn the respect of your peers in the process:

1. Evolve Your Leadership Style

If you think you know everything you’re over-estimating yourself. Having a know-it-all attitude when being promoted is the first way to earn the disapproval of those you are meant to lead. Be willing to listen, learn, and grow in your management position, and those who are following you will do the same. People will be more willing to listen to your opinion, and keep an open mind when tackling difficult problems. Leading by example is vital to earning respect and showing a capacity to evolve will prove to those around you that you are the right person for the job.

2. Engage with Your Team

No one works hard for someone they don’t like. It’s a common fact. If you are the boss, have an open door policy. Get to know the people who are working for you, and in taking the time do to so, you will get them to work harder for you. Everyone works hard for people they respect and care about. If you prove to those under you that you truly respect and care about them, they will follow you anywhere.

3. Earn, Don’t Demand, Respect as a Leader

You can’t demand respect any more than you can buy it. Respect is earned. Being respectful to others is the fastest way to earn that respect. You can’t gain anything you’re not willing to give. If you are respectful of people’s opinions, theories, and ideas, they will be respectful of yours, even if it’s coming in the form of directions. When you respect others, and they respect you in return and it’s easier to inspire them into action.

4. Be Accountable for Your Mistakes and Share the Spotlight

Anyone who has ever admitted they made a mistake is remembered and usually forgiven. If you are the leader, and you take responsibility when things go wrong instead of blaming your team, you will see how quickly you earn their respect. At the same time it’s important not to take credit for all the glory but to deflect the spotlight to your team. Any successes should be shared and your failures should be singular. The captain goes down with the ship and any head coach on a losing team is the first one to go. Hold yourself to higher standards, and admit your faults.

5. Be Transparent

Being open about what is going on in the office will earn the trust of those working with or for you. Communicating goals, deadlines, ideas, and expectations make for a much more enjoyable working environment. If the team knows what the leader needs to succeed, it’s easier to fulfill those needs. If someone on the team is struggling, be open with him or her about how they are doing, and how he or she can improve. If a project is stalling, tell the team what the problem is. Letting your team in on the goals of the company can help rally your team into individual tasks. If something goes wrong, share the information with the team. Honesty is the best policy, especially when it comes to earning the respect of others.

Dan Schawbel is the managing partner of Millennial Branding, a Gen Y research and management consulting firm. His new book, a New York Times best seller, is called Promote Yourself: The New Rules For Career Success (St. Martin's Press) and his previous book, Me 2.0, was a #1 international bestseller.