In order for evidence to be heard in a criminal case it has to be considered admissible.
Unless evidence supports your version of events or tends to make you seem innocent of the accusations, it's always to your advantage to have the evidence declared inadmissible -- so it's essentially your attorney's job to argue against letting it be heard in court.
On the other hand, it's the prosecutor's job to try to get that same evidence admitted into court against you.
The odds are high that your criminal defense attorney and the prosecuting attorney will spend a lot of time arguing about what should and shouldn't be admitted. It's the judge's role to make that determination.
He or she will essentially make the determination based on three factors:
1. Is the evidence relevant?
In other words, it has to help either disprove or prove something alleged as a fact -- and that fact has to be important to the crime. For example, if you're accused of assault and battery, the fact that you are a bookie on the side isn't relevant evidence unless the assault and battery is alleged to be related to your bookie business.
2. Is the evidence material?
Material evidence is anything that helps settle an alleged fact that is in dispute. If everyone agrees on something, then the evidence is generally not material. For example, if it's clear that you had a long-standing grudge with the victim in an assault and battery case, there's no reason to bring in seven different people to testify that you had a personal grudge against the victim.
3. Is the evidence competent?
Competent evidence is that which is generally considered reliable. That can change somewhat over time. For example, genetic evidence, like DNA, has gained credibility and become competent in the eyes of the law over time.
Pay close attention to your attorney's arguments as the case goes along -- you may be able to offer information that will help your attorney raise challenges against evidence offered in one of those three ways.
Source: FindLaw, "Evidence: The Concept of "Admissibility"," accessed Nov. 24, 2017