Sleeping pills can cause side effects, and certain medications, such as antihistamines may not be suitable for long-term use. A person should work with a doctor to determine what is causing their insomnia before taking sleep medications every night. A doctor will be able to advise on the best and most sustainable way to treat insomnia.