In April, Rudy Giuliani, President Donald Trump's personal attorney, called Michael Cohen — Trump's former personal attorney — a "good man." In May, Giuliani called Cohen an "honest, honorable lawyer."

Now, Giuliani calls Cohen an "incredible liar" who has "been lying for years" and has a "tremendous motive to lie now." Giuliani doesn't see "how [Cohen] has any credibility."

Another statement was less insulting but among the most disingenuous he uttered: Giuliani called Cohen "the kind of witness who can really destroy a whole case."

He's also exactly the kind of cooperating witness who could make a case and one Giuliani gladly would have embraced when he was the U.S. attorney for the Southern District of New York.

Giuliani knows, as a former top prosecutor, that often the only witnesses to crimes are the criminals themselves. As a prolific prosecutor of the Mafia, Giuliani knows that organized crime leaders use underlings to carry out their will. To take down criminal organizations, it is necessary to turn criminals at the bottom against those at the top.

By definition, all cooperating witnesses are the "kind of witness who can really destroy a whole case" once they are cross-examined by the defense.

Cooperating witnesses are a walking contradiction. They are villains working for the lawmen. They are admitted liars swearing they are not lying. They are doing a good thing but not doing it out of the goodness of their hearts.

Cross-examination will bring out the cooperator's criminal history, the potential penalties he's facing, the deal he struck with prosecutors and his ever-present motive to lie. Cross-examination of a "CW" will typically feature some version of the following:

Q: You'd do anything for your wife and kids, right?

A: Yes.

Q: Would you die for them?

A: Of course.

Q: And if you'd die for them, you'd certainly lie for them, correct?

A: Ummm.

There's no right answer. Of course, they would lie on the stand for the right reason.

In fairness, prosecutors would reject this characterization of cooperating witnesses, claiming that the government carefully vets people before deciding to "cooperate" them or to offer them any deal to testify.

This means days or weeks of meetings with prosecutors and agents in secret locations to debrief and test the veracity of the witness' information. The government recognizes that the cooperating witness has a motive to fabricate. It's in the government's interest to know the truth before deciding to offer a deal or immunity.

Giuliani knows credibility issues are not always fatal to a cooperating witness. On the whole, jurors are often willing to believe cooperating witnesses and forgive the fact that they are swindlers, grifters, even killers.

There's just something about an ex-best friend or ex-business partner who takes the stand, confesses his own sins and points at the defendant in court, saying: "That's the guy."

Giuliani knows this because his U.S. attorney's office used much less credible cooperating witnesses: gamblers, loan sharks and labor extortionists — and that's just one cooperating witness he embraced as a prosecutor. At the time, Giuliani boasted that Vincent "Fish" Cafaro was the highest-ranking Mafia member in New York ever to cooperate with the authorities.

Giuliani is right when he says it's hard to see how Cohen has any credibility. What he should add is that in the universe of cooperating witnesses, Cohen may be more credible than most — especially some of the criminals Giuliani "cooperated" with in his career as a prosecutor.

Danny Cevallos is an MSNBC legal analyst. Follow @CevallosLaw on Twitter.