It doesn’t matter if the prosecution or the defense thinks you’re a valuable witness, the process is the same for both sides. The first thing they will do is officially summon you to appear. This is done through a formal process in which a court representative hands you the information about how you’re required to appear in court.
Your own opinion on the case and judicial process aren’t relevant. As soon as the summons has been handed to you, you’re required to show up. Failing to do so will result in your being charged with contempt of court. Depending on the case and the mood of the prosecution/judge, it’s possible that a warrant will be sworn out for your arrest and you’ll spend some time in jail.
When you do honor the summons and appear in court on the appointed day, you will report to the court officer who will tell you where to go. If you’re lucky, you won’t have to wait long before it’s your turn to testify, however in many cases, you’ll find yourself waiting for a few hours and might even have to come back to court on a different day.
At this point, it’s extremely important that you don’t talk to anyone about the case. The reason for this is simple, you don’t want the conversation to alter your direct memories about the case or the person you’re testifying about.
When you’re called to testify, you’ll be sworn in. As soon as that’s completed, both the prosecution and the defense will ask you a series of questions that pertain to the case. It’s extremely important that you answer each question as honestly as possible. Not only will lying jeopardize the case, but if you’re caught deliberately lying, you’ll be charged with perjury and arrested.
Once you’re done testifying you usually have the option of either remaining in the courtroom and watching the remainder of the trial or going home. The one exception to this is if either the prosecutor or the defense expresses interest in recalling you, in which case you’ll go back to playing a waiting game until they either recall you or formally announce that they no longer require any additional testimony from you.