Unconsciousness is a state in which a living individual exhibits a complete, or near-complete, inability to maintain an awareness of self and environment or to respond to any human or environmental stimulus.
Loss of consciousness should not be confused with the notion of the psychoanalytic unconscious, cognitive processes that take place outside awareness (e.g., implicit cognition), and with altered states of consciousness such as sleep, delirium, hypnosis, and other altered states in which the person responds to stimuli, including trance and psychedelic experiences.
In jurisprudence, unconsciousness may entitle the criminal defendant to the defense of automatism, i.e. a state without control of one's own actions, an excusing condition that allows a defendant to argue that they should not be held criminally liable for their actions or omissions.
Hence epileptic seizures, neurological dysfunctions and sleepwalking may be considered acceptable excusing conditions because the loss of control is not foreseeable, but falling asleep (especially while driving or during any other safety-critical activity) may not, because natural sleep rarely overcomes an ordinary person without warning.
This can be relevant in cases of sexual assault, euthanasia, or patients giving informed consent with regard to starting or stopping a medical treatment.