Insomnia is a common symptom of medical and psychological conditions, such as depression or anxiety. But sleep disturbances can also contribute to or even cause these other issues. Nearly 40 percent of depressed patients found that they had difficulty sleeping before their very first depressive episode. If you start having serious trouble sleeping, don’t write it off—there are lots of things you can do to stop insomnia before it becomes a major problem.

MORE: A Better Way to Treat Insomnia