When a witness is giving evidence in court they cannot use what someone else
has said as evidence. This is called hearsay. The court must hear from the
person themselves to consider it as evidence. For example, if you are a witness
in a trial, you cannot give the following evidence, "My mother told me she saw
the accused at 3pm". This is evidence of a statement made out of court and is
hearsay. For that evidence to be introduced, your mother would have to take the
stand and describe what she saw herself.
Exceptions to the hearsay rule
Not all out-of-court statements are hearsay. For example, if an accused claims that they are dumb, you can give evidence that you saw and heard them say "I want an ice-cream". This evidence is not being introduced to prove that the accused wanted an ice-cream, but to prove that they can speak. For that reason, it is admissible.
The most important exception to the hearsay rule is admission or confession evidence. Generally, it is assumed that someone would not make a statement against their own interests, so the statement must be true. This means that you can give evidence that the accused said to you on the day the victim died, "I did it. I killed him". Normally, this would be hearsay evidence as it is an out-of-court statement and it has been introduced to prove that the accused killed the deceased. However, because confessions are an exception to the hearsay rule, that evidence can be admitted in court.
You should get legal advice for more detailed information on this.