How do allegations and high-profile cases involving public officials affect public trust in law enforcement agencies?

There are frequent news reports about officials being accused of corruption or misconduct, such as the IRS officer denying bribery claims. I want to analyze how such incidents influence people's perception of law enforcement and what can be done to restore trust.