Attorney-client communications are typically privileged, meaning that no one can force the lawyer or client to disclose them. But there's an exception to the attorney-client privilege where crime or fraud is at issue.
Suppose the prosecution wants to force a lawyer to disclose a statement by the lawyer's client on the grounds that it falls into the crime-fraud exception. The prosecution has the burden to prove the exception applies. The following is a common procedure for determining whether it actually does apply.
In order for the court to even consider the issue, the prosecution must provide enough facts to support a good faith belief that the exception applies. Presenting sufficient facts is only the first step. The prosecution will have to show more to actually overcome the privilege.
A judge who thinks the prosecution has presented enough facts can hold a hearing and consider testimony. The judge may question the attorney about the communication and its context. The client probably wouldn't testify, because doing so could very well incriminate her in the crime or fraud. (See The Privilege Against Self-Incrimination.)
If the defense creates enough doubt about whether the crime-fraud exception applies, the prosecution won't be able to force disclosure of the statement. But if the prosecution establishes to the judge's satisfaction that the exception applies, the judge will order the lawyer to reveal the statement.