An analgesic is a type of medication used to relieve pain. It works by blocking pain signals in the brain or by interfering with the chemicals that cause pain perception. Common examples include non-steroidal anti-inflammatory drugs (NSAIDs) like ibuprofen, as well as opioids like morphine. Analgesics can be used for various types of pain, ranging from mild headaches to severe chronic pain conditions.