An analgesic is a medication or substance used to relieve pain without causing the loss of consciousness. Analgesics can be classified into two main categories: non-opioid analgesics, such as acetaminophen and nonsteroidal anti-inflammatory drugs (NSAIDs), and opioid analgesics, like morphine and codeine. They work by blocking pain signals in the brain or reducing inflammation. Analgesics are commonly used to manage acute and chronic pain conditions.