A narcotic is literally a drug that induces sleep. The word "narcotic" is taken from the Greek word narkos, meaning "sleep." The term most commonly refers to opioids such as heroin, morphine, and codeine.
The term narcotic can also be used to describe any illegal drug, including marijuana or cocaine, even though these drugs are not considered narcotics in the medical context. Due to this common confusion of the term, medical professionals typically refer to narcotic pain relievers as "opioids" or "opioid analgesics."