Self-medication

Self-medication is the use of drugs or self-soothing forms of behavior to treat a perceived or real malady. [...]

Analgesic

An analgesic (also known as a painkiller) is any member of the group of drugs used to relieve pain [...]