There are three types of insomnia: Transient, Short-term and Chronic. The last one rarely responds to drug treatment with hypnotics.
Hypnotics are of two types: benzodiazepines (such as nitrazepam) and newer compounds like zaleplon, zolpidem and zopiclone. All of them act through action on GABA receptors in the brain, one way or the other.
Hypnotics (Sleeping pills) should be taken only when sleeplessness causes severe distress and for minimal period. The maximum allowed is: zaleplon - 2 weeks, zolpidem - 4 weeks; zopiclone - 4 weeks.
There is possibility of rebound insomnia when the medicine is withdrawn, more with benzodiazepines and slightly less with other agents.
They act when a person wishes to go to sleep, though all of them will cause drowsiness.