A statement made out of court cannot be introduced in court to prove the content of the statement. 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 it is "hearsay". For that evidence to be introduced, your mother must take the stand and describe what she herself saw.
Not all out-of-court statements are hearsay. For example, if an accused is claiming that he or she is dumb, you may give evidence that you saw and heard him or her say "I want an ice-cream". This evidence is not being introduced to prove that the accused wanted an ice-cream, but it is being introduced to prove that he or she can speak. For that reason, it is admissible.
The most important exception to the hearsay rule is admission or confession evidence. It is generally assumed that a party in a case would not make a statement against his or her own interests unless the statement was true.
This means that you may give evidence that the accused said to you on the day that 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 rule against hearsay, that evidence will be admissible.
The general rule is that hearsay evidence is not admissible. If you are giving evidence and start to say something that amounts to hearsay evidence, you may be interrupted by one of the parties in the case or the judge and asked to stop.
For more detailed information you should seek legal advice.