Step 1: The question asks which compound in opium poppy (Papaver somniferum) gives pain relief.
Opium poppy latex yields a group of alkaloids called opiates, and among the common ones (morphine, codeine, papaverine, thebaine), codeine is specifically known and used clinically as an analgesic and antitussive agent.
Checking the other options against their real plant sources rules them out: Shikonin is a naphthoquinone pigment from Boraginaceae roots, Diosgenin is a yam derived steroid precursor, and Scopolamine is a Solanaceae tropane alkaloid used as an anticholinergic, none of which come from poppy. Answer: Codeine.