Benzodiazepines and Z drugs ( e.g. zopiclone, zolpidem…)are drugs that are prescribed to help with symptoms of anxiety, sleeping difficulty and also occasionally for other reasons.
They should be used sparingly and ideally less than 2 weeks, and are not normally advised for more than 4 weeks.
Taking it longer than this cause significant risk of dependence ( addiction and withdrawal symptoms if you try to reduce them) and also the medicine losing its effect (tolerance). You can be left with symptoms or dependence that are worse than the original problem.
The misuse of Z-drugs (Royal College Of Psychiatrists)
Patient.info has good articles on insomnia