A court can generally force you to testify as a witness. If your testimony is required, they’ll send you a subpoena by email or deliver it through a courier.  The subpoena, which is a simple court document, will clearly state what type of testimony is needed from you. It will contain the following information:
The name of the case
The date and time the case will be heard
The court you must attend
You may get a subpoena duces tecum, which means that you must bring along the documents listed in the subpoena to court.
You can be imprisoned for contempt of court if you don’t show up to court on the date and time mentioned in the subpoena. You cannot refuse to testify as a witness because you're afraid to give evidence or you're intimidated by one of the parties in the case.