What procedures do courts use to determine if a defendant is incompetent to stand trial?
In general, a person who is accused of a crime must be able to understand the basics of the legal proceedings against them. If not, they will be found not competent to stand trial for the crimes of which they are accused. Courts typically try to determine whether defendants are competent by using a psychiatrist (or more than one psychiatrists) to examine the defendant and evaluate his or her competence.
The psychiatrists test the defendant for all sorts of disorders (both physical and purely mental) that could affect his or her competence to stand trial. The link below, for example, lists five separate broad types of disorders for which the psychiatrists might test the defendant. Please follow the link for detailed information.