MOCK - It is the cornerstone of testimony. It is actually a mnemonic for Memory Oath Communication and Knowledge.
Everyone can give testimony unless they are excluded by MOCK. Cal Evid 700
It is the four things a witness must have in order to give testimony in a court of law.
Memory - A witness must have an independent recollection of an event. Essentially a person must be able to describe a memory from their own mind in order to give testimony on that memory. Cal Evid 702
Oath - A witness must be able to give an oath to tell the truth and understand the oath they are giving. A child or an incompetent would be unable to give an oath because they would lack the capacity to understand what the oath meant. Cal Evid 701(a)(2)
Communication - A witness must be able to communicate their testimony in such a way as to be understood. Interpretation is allowed and the communication need not be verbal. Cal Evid 701(a)(1)
Knowledge - The individual must have personal knowledge of the subject upon which they will testify otherwise it may be hearsay. Presenting hearsay evidence is a whole can of worms which has scared law students for decades. Cal Evid 702(a); Cal Evid 801, et. seq.
How Does This Apply to You?
If you are ever asked to give testimony in a courtroom or deposition setting, it is important that you are competent to give testimony. It is also important to have a lawyer present to protect your interests. During the course of testimony, if you are ever unable or incompetent to give testimony you should immediately inform your attorney so the proceeding can be stopped.
Having a lawyer present during testimony can protect you from being "tricked" by another attorney. An attorney can object to questions on your behalf. Finally, if you ever become unable to give testimony, your lawyer can conclude the proceeding on your behalf and make certain your legal rights are protected.
Often times, people are subpoenaed to testify in a case in which they are not involved. The person may give testimony without a lawyer present but it is done so at their peril. Remember testimony under oath which is recorded can come back to bite you. Famous examples include Barry Bonds, Bill Clinton and Lil Kim are all people who gave testimony under oath which later caused them serious problem.
Save yourself the trouble, at least speak with an attorney before giving testimony.