If memory serves, the police detective Lennie Briscoe on "Law & Order" said, more than once, something along the lines of, everyone in jail is innocent -- just ask them. Not everyone now incarcerated is innocent, but as the work of the Innocence Project can attest, there are some. And if even the lowest estimate of the numbers of wrongfully convicted is correct, it means more than 20,000 inmates should be walking free right now.
The foundation of the system of justice in West Virginia, Pennsylvania and the rest of the United States is that any person charged with a crime is considered innocent until proven guilty. But what a court might accept as evidence and juries might accept as proof can vary. With so much riding on the outcomes delivered by this human-run institution, it's important to mount as strong a personal defense as is possible by working with skilled legal counsel.
There is any number of possible defenses that an accused individual might be able to present. The most basic would be to prove that the defendant didn't commit the crime charged. But that does put the onus on the defendant to assemble and present that proof, and under the innocent until proven guilty tenet, that onus should rest on the prosecution.
To counter prosecution evidence, it can help to have an unshakeable alibi or present physical evidence that shows you could not have done what is charged. Anything that might serve to provide reasonable doubt for the judge or jury could be useful.
Other defenses stem from a theory that the defendant committed the crime, but should not be held responsible for some reason. The possible reasons might include that the crime was committed in self-defense. Claiming insanity is rarely done, but it may be viable if it might cast doubt that the crime was committed with intent.
Claiming to have been mentally incapable because of inebriation or drug impairment has been known to be used on occasion. But it more often than not only reduces the possible charges and thus the possible penalty in the event of a conviction.
If you were arrested after being caught in a police sting operation, entrapment might be a viable defense. But if your history is such that it might be reasonable to think you were inclined to have committed the crime, it might not stand up to court scrutiny.
Source: FindLaw, "Defending Yourself Against a Criminal Charge," accessed Nov. 19, 2015