American courts use the exclusionary rule to deter police officers and other government agents from abusing constitutional rights. According to the rule, courts will suppress evidence that the government obtains through unconstitutional conduct—often an unlawful search or seizure. Suppression means that the evidence in question will be inadmissible for most purposes in the defendant's eventual trial. If a judge suppresses crucial evidence, the prosecution may have no other choice than to dismiss charges. (See What Is a Motion to Suppress?)
The exclusionary rule applies to evidence that's a direct product of a constitutional violation. It also comes into play when such a violation leads less directly to incriminating evidence.
Suppose officers, without reasonable suspicion or probable cause, stop a man walking down the street. Though he's done nothing to deserve it, they search him. They find in his pocket a scrap of paper saying, "Drugs are under garbage bin at 123 Jones Street." The officers go to the address, peek under the garbage bin they see there, and find a bag of various narcotics. Both the note and the drugs were a product of an illegal stop and search, so neither will be admissible to prove the man's guilt.
EVIDENCE NOT ALWAYS INADMISSIBLE
The exclusionary rule generally requires that evidence that results from an unlawful detention or arrest be excluded from court. But not always.
Suppose a warrant is out for your arrest. An officer who's unaware of the warrant detains you, but not because you were doing anything wrong. Maybe the officer is speculating that you're up to no good. Whatever the reason, it's not reason enough: The policeperson doesn't have reasonable suspicion that you have committed or are committing a crime.
The officer asks for your identification, has dispatch run a check, and learns about the warrant. The cop arrests and searches you, finding some kind of contraband in your pockets.
Even though the stop was illegal because it wasn't based on reasonable suspicion, the contraband could very well be admissible against you in court. The U.S. Supreme Court has held, essentially, that arrest warrants can retroactively justify illegal detentions. (For much more on the rules in this area, see this article on the "attenuation doctrine.")
For more information on the exclusionary rule, including exceptions, see Fruit of the Poisonous Tree and Police Searches and the Good Faith Exception. Also see Statements Obtained When Police Violate Miranda.