Refers to medication that relieves pain. The glosses 'sedative', 'tranquilizer', and 'anodyne' are less common or broader; the core meaning is pain relief.
I took a painkiller because my tooth hurt.
この鎮痛剤は頭痛によく効く。
This analgesic works well for headaches.
I had a headache, so I took a painkiller.
This painkiller works quickly.
Please take the painkiller according to the doctor's instructions.