When a person is charged with a criminal offense, he or she must be able to understand the legal situation. This includes proposed charges, potential penalty if convicted, the meaning of various pleas available and the roles and responsibilities of various people in the courtroom. The person must also be able to assist his or her attorney in the preparation of a defense. If someone can do these things in a rational way, the person is considered to be competent to stand trial. If someone has a mental illness or intellectual disability and is unable to understand his or her legal situation or assist his or her attorney, the person is said to be incompetent to stand trial.