Telling the truth requires that a witness testify accurately about what he or she knows. If you tell the truth and tell it accurately you have nothing to fear on cross examination.
If you do not know the answer to the question, say you do not know. Do not guess or speculate. On the other hand, give positive, definite answers when you clearly remember what happened. Listen carefully to the questions asked. Be sure you understand the question before you attempt to give an answer. You can't possibly give a good, clear answer unless you understand the questions. If you don't understand the question, ask that the question be rephrased or repeated until you are able to understand. If you do not know the answer to the question, state that you do not know.
Do not volunteer information not actually asked for. You may explain your answer if the answer cannot be correctly understood on the basis of a simple yes or no.
If you make an error in answering a question and decide that you have made an error, ask permission of the court to correct the error before you leave the witness stand. There is nothing wrong in doing this as people often make this type of error. If you do not realize your error until after you leave the witness stand, advise the deputy district attorney as soon as possible.
You may be excluded from the courtroom when other witnesses are testifying. This is to ensure that the testimony or memory of one witness does not influence the testimony of another.
There are no laws or rules prohibiting you from telling the defendant's attorney your testimony before you take the stand. Nor are there any laws that require you to talk to the attorney before you take the stand. This is your decision and you should not feel pressured to speak or not to speak to anyone about the case.
If you choose to speak to the defense attorney, you may wish to have an additional person present or a tape recording made to avoid later misunderstandings and misquotation.