Substance abuse, mood, anxiety, and psychotic disorders are a few of the many conditions that involve insomnia. It is unknown why insomnia is such a common symptom among these illnesses.
Insomnia may not only be a symptom of some psychiatric diseases, it may also contribute to these disorders. Depending on the person, it may be important to get targeted treatment for insomnia, especially when the treatment of the primary disorder(s) does not improve the patient's sleep.
If you asked this question 20 years ago, the answer would have been "insomnia is a symptom." Over the years, this perspective has changed. It is now recognized that insomnia may occur and not be associated with acute psychiatric or medical illness. This is called Primary Insomnia (or Psychophysiologic Insomnia). The question now is whether such a disorder represents a risk factor for, or a sign of, psychiatric and/or medical illness. While the jury is out regarding insomnia and medical illness, the evidence with respect to psychiatric illness is clear and compelling. Patients with persistent and untreated insomnia are at between 2 and 10 times the risk for new onset or recurrent episodes of major depression. There is also good evidence that insomnia is a risk factor for the development and/or recurrence of anxiety disorders and substance abuse.
If the insomnia is acute (less than approximately 14 days), there are two viable options. First, do nothing. If one does not compensate for sleep loss (does not go to bed earlier, get out of bed later, stay in bed waiting for sleep, nap, etc.), it is likely that "the ship will right itself". When adopting this strategy (the "tough-it-out" approach), the one thing you can do is judiciously use caffeine to maintain daytime function. Second, visit your doctor, who may prescribe a sedative.