に効く

work for

→ に
phrase Uncommon #12,539
work for Used with the condition or problem something is effective against, as in a medicine that works for a headache. The verb 効く can also mean “to be effective” or “to take effect.”
JA: 頭痛に効く薬を知っていますか。
EN: Do you know a medicine that works for headaches?

ネズミに効くならやっぱり毒だよね?

If it works on mice, then it must be poison, right?

— 人生スイッチ (2014)

この薬は肝臓に効く。

This medicine is effective for the liver.

この丸薬は心臓に効く。

This pill is good for the heart.

この薬はあなたの病気に効くでしょう。

This medicine should help with your illness.

塩水でうがいすると、咳に効くんだよ。

Gargling with salt water helps relieve a cough.

この薬は頭痛に効く。

This medicine works for headaches.

薬がそれぞれ何に効くのか、昔は聞いたことがあったはずだ。

I must have heard what each medicine was for a long time ago.

それに効くいい薬があるぞ

I've got a good medicine for that.

— ザ・マン・フロム・アース (2007)