Medicine should only be used according to a doctor's instructions.

Literal

Medicine [topic-は] doctor [gen-の] instructions [by-によって] only use-[passive-される]-[should-べき]-[polite-です].

The Japanese here writes 使用 in hiragana as しよう, an unusual choice that flattens the kanji distinction — context tells the reader the intended sense is 'be used.' The pattern ~によって ('by means of, according to') marks the authority governing the action, and のみ is the formal/written equivalent of だけ ('only'). Stacked: passive ~される + ~べき + polite です. Heavy formal writing register.