If you are a witness you must wait outside the courtroom until you are called into court so that you are not influenced by the other witnesses’ evidence. You will stand in the witness box and be “sworn in” by the registrar (where you swear on the bible or affirm that the evidence you are about to give “will be the truth, the whole truth and nothing but the truth”). After that you can sit down and give your evidence.
Often lawyers will prepare a document called a “brief of evidence” for you, that sets out what your evidence will be and what you will say. This is a guide – it cannot be taken into the witness box or read from and does not need to be memorised. Witnesses have to answer the questions asked of them – unless their lawyer objects to a question and the judge rules that they do not have to answer that question.