Having to be a witness in a court of law can potentially be a very difficult situation to be in. The mental anguish and the anxiety can definitely wear down your mind and emotions. To make it a little bit easier on you, though, you might take solace in the fact that what you are doing as a witness can definitely help a person or a group of people get much deserved justice. No matter how much inconvenience you've had to endure, think about it this way - those people who have been wronged (or that defendant who has nothing to do with the crime) probably have had a much tougher time than you. It's tough, but sometimes, one has to step up to the plate and do the right thing.
During the days leading to your court appearance, go over the specific details and facts that you remember from the case. It would be very important for you to correctly state the actual chronology of events with relation to the presence and absence of certain people in the story.
Coordinate with the lawyer who has asked you to testify for their side. The lawyer can probably give you a few pointers on how to be clearer and more precise with your statements. He can also cross-examine you in simulation to somewhat give you the feel of the actual courthouse situations. Make sure that you also know when you have to appear in court. Chances are, you've never been to the courthouse before, so ask for directions to make sure that you don't get lost and cause a delay in the proceedings.
Once it's your time to take the witness stand, approach the stand slowly and get yourself in a comfortable but dignified position. Try to sit up straight. The proceeding is quite serious, so a little bit of decorum is required. Be yourself, though. Do not try to act like somebody else.
You would then be asked by the lawyers to testify. The side who asked you to testify first will be the one to address you from the bench. The lawyer of the other side would then have his or her turn to clarify whatever details he or she feels leaves a shadow of a doubt on the things that you say. Don't be fazed by questioning. The questioning is almost always only meant to flesh out the facts and the details.
Tell the truth. This is probably the best advice you can give anyone who is about to take the stand. Try to tell your version of what happened in the most simple and honest manner. Don't be too emotionally invested in the case. You are not supposed to be concerned about helping or not hurting a certain side. Your role in the proceedings is that of resource person for what truly happened. Try to talk slowly and clearly to make sure that the jury and judge hear your testimony clearly. Lastly, answer questions directly and never try to add details to the story just because you couldn't answer a lawyer's question.
It's our duty to aid the system in serving justice to all parties concerned. Being an honest and credible witness on the stand is one way we can help ensure the integrity of the law and the system.