Hi,
Every medicine can potentially have adverse effects. The prescribing Doctor takes into account the potential risks and potential benefits and a medicine is prescribed only if risk/reward ratio is favorable.
Insomnia (difficulty getting sleep) is usually a symptom of some other underlying cause (usually Mental Health Issues) and that cause needs to be resolved rather than just getting symptom relieved with sleeping pill.
Modern medicines used for sleep are usually free of serious side effects when taken as per the medical advise.
Best wishes
Health Tips
Do not take sleeping pills without proper medical advice.