It's clear that Trevor Reznik's insomnia in The Machinist is caused by the guilt of the hit and run - but why doesn't he remember such an event?
Situation-Specific Amnesia is one possible side effect of experiencing a Traumatic Event. It is a defense mechanism of the brain, attempting to protect against PTSD. The same cause of Trevor's Insomnia and OCD like manners (repetitive hand washing). By blocking out the memory, the brain is trying to protect itself from the painful psychological trauma.
Psychogenic amnesia, also known as functional amnesia or dissociative amnesia, is a disorder characterized by abnormal memory functioning in the absence of structural brain damage or a known neurobiological cause. It results from the effects of severe stress or psychological trauma on the brain, rather than from any physical or physiological cause. It is often considered to be equivalent to the clinical condition known as repressed memory syndrome.
There are two main types of psychogenic amnesia: global amnesia and situation-specific amnesia. Global amnesia, also known as fugue state, refers to a sudden loss of personal identity lasting a few hours or days, often accompanied by severe stress or depression and often involving extended periods of wandering and confusion. It is very rare, and usually resolves over time (although memory of the fugue episode itself may remain lost), often helped by therapy. Situation-specific amnesia is a type of psychogenic amnesia that occurs as a result of a severely stressful event, as part of post-traumatic stress disorder.
See also Wiki: Effects of trauma on memory