Before the evolution of modern psychology, depression was thought to be a mental condition, which only affects the weak. However, we now know that depression is a mental state and irrespective of the physical and social condition of a person it can still effect and have disastrous consequences on the victim and others around. Though some people might attribute factors like failures, rejection, break-up as root cause of depression, usually it’s more than just that. If you are suffering from constant depression, what you need is medical care and the sooner the better.
Insomnia can be a cause, symptom, and after effect of depression. If you are having insomnia and unable to determine the root cause of the problem, it could very well be depression. For prolonged depression, you need to consult a therapist and resolve the issue rather than going for medication such as sleeping pills.