Please tell me how to take this medicine.

Literal

Medicine [gen-の] drink-way [obj-を] teach-[request-てください].

~方 ('way of doing') attaches to the verb stem to nominalize it as a how-to: 飲み方 = 'the way of drinking.' For medicine, 飲み方 covers timing, dosage, and method. A basic but high-utility pattern: 食べ方, 読み方, 使い方 all work the same way.