You're there to give evidence of what you saw and heard. So you stand in the witness box, take the oath to tell the truth, and then you are questioned by the lawyer for your side. You're there as a witness for either the prosecution (who say the defendant did it and they're expecting you to support that) or for the defence (who say he didn't do it and they're expecting you to support THAT). So they ask questions which will mostly be designed to get you to tell the court your story of what happened.
Undoubtedly the lawyer will have gone through this with you first and know what they're expecting you to say. How else are they going to know what are the best things to ask? And of course it helps you know what you will be asked about. If you forget anything important, they'll just ask another question about it.
When they're done, the lawyer for the other side will cross-examine. This will be hostile and you can't prepare for this. "It wasn't like that, was it? I put it to you that it really happened this way. You couldn't possibly have seen this thing that you say you saw, could you?" That kind of thing. Don't get angry, they're only doing their job, and the judge will step in if they ask anything they shouldn't.
The first lawyer may get to ask a few more questions to clear up anything that came out of cross-examination, though that's unlikely, and then that's you finished. On with the next witness! The judge (and jury if there is one) have heard everything you have to say about what you witnessed, and that's all the court wants from you.
Being questioned by the other side is designed to really dig out the truth. And speaking as someone who has served on a jury, it's really useful as a juror to hear that and help me make up my mind whether I can believe you.
You can't go into court before it's your turn so that you won't be biased by anything previous witnesses said. You can stay after they're finished with you and watch the rest if you like, as what you see now can't affect the trial - you've had your say already!
Talking of which, trials are public so that justice can be seen to be done. So you could go along to the court on a previous day and watch another trial, so you can really see what happens and it won't all be new to you.