Insomnia medication is a type of medication that helps people to fall asleep and stay asleep. It can be used in combination with other treatments, such as sleep counseling, to help improve the quality of sleep for people who have difficulty sleeping.