I threaten to take you to court. I threaten to sue you. I threaten to prosecute you to the fullest extent of the law. To threaten someone is not illegal in all circumstances. Just saying.
It depends.
There is a decision by the Supreme Court of California saying that when a lawyer wrote to a prominent entertainer and said, "you raped my client in Las Vegas and unless you pay her $10 million I am going to sue you, report you to the police, and tell the press," the lawyer was guilty of extortion.