is a very common complaint. Most people experience this on occasion. However, if there is continued and troublesome insomnia that is affecting your life -- this needs to be evaluated. I would recommend that you see your primary care doctor
as there many causes that can be potentially treated.
Sleeping pills are not recommended in general. While some work to transiently help you sleep -- they are simply "covering up" the problem. It may be appropriate to take them, but the important thing is to first figure out why you have insomnia. For this, I would recommend discussing this with your primary care doctor. If appropriate, he or she may prescribe you some sleeping pills.
As to what is causing it -- there are many causes. A big distinction is if you have trouble falling asleep or trouble staying asleep -- as the two types of insomnia have different causes.
Some of the common causes include:1-depression ; 2- thyroid problems; 3-gastric reflux 4- urinary problems, 5- lung problems such as sleep apnea
and many more. However arguably the most common cause of insomnia is poor "sleep hygiene." This is a term used when people are setting themselves up to not sleep i.e. having bright lights on, napping in the day, eating/drinking before bed etc.
Talk to your doctor for more information.