Right to Non Self-Incrimination
A right to non self-incrimination exists in many jurisdictions. In the United States, this is called the right to remain silent. The court recognizes this right in several ways. First, the court has recognized the right to non self-incrimination when it fashions common law privileges such as the attorney-client privilege, marital confidences and spousal testimonial privileges, and the priest-penitent privilege. In the United States a defendant is notified of this right by police through Miranda Warnings.
Because the defendant has a right to non self-incrimination, she cannot be compelled to be a witness by the court.
Country Specific Examples
A criminal defendant has the right to non self-incrimination at trial. This right comes from the 5th Amendment's right to remain silent. 
A defendant in criminal proceedings has the right to refuse to give testimony that would incriminate him/her in the present trial or a subsequent trial. If questions seeking to elicit incriminating evidence are raised during trial, counsel for the accused must raise timely objections to prevent any response that may have a prejudicial effect against the defendant.
- See Malloy v. Hogan, 378 U.S. 1, 6 (1964) (extending the 5th Amendment's protection against compulsory self-incrimination in court extends to the states through the 14th Amendment).