Alcohol is often used as a form of self-treatment of insomnia to induce sleep.
Opioid medications such as hydrocodone, oxycodone, and morphine are used for insomnia that is associated with pain due to their analgesic properties and hypnotic effects.