As a crime victim or witness you will be receiving a subpoena. This is a court document requiring you to be present in court at the time and place stated. Your first personal contact may be for pre-trial preparation, when the Commonwealth's Attorney's Office calls to discuss the facts of the case with you. When you come to court for trial, you will be sworn in.
The defendant may ask the judge to have the witnesses remain outside the courtroom until they are called on to testify. Bring a book to read to pass the time. When on the stand, you will be questioned first by the prosecuting attorney and then by the defense attorney.