I minored in Japanese without realizing this, and didn’t have a grasp on it until I came to the country this year.
In Japanese, situations where a passive sentence is more natural, and situations where an active sentence is more natural, are often reversed from English. (Correspondingly, situations where a transitive or intransitive verb would be used are also switched.)
It’s something you’ll just pick up from reading and listening, as well as being familiar with passive constructs (conjugations and particles), but keep your eyes/ears open for it. When translating, it often makes more sense to swap the passive and active according to what would be most natural in the same situation in English.
Hence the grammatically literal meaning of “I was told by the doctor …” becoming “The doctor told me…” in the sentence above.
The empathetic angle to when to use each makes a lot of sense. Above, you don’t really want to stress the doctor’s role in the situation, as it’s personally affecting news.
There are some other strange examples that fit along with this, though. Ex. 見える, 聞こえる, and わかる all being intransitive, even though English would render the same thoughts as “I can see it,” “I can hear it,” and “I understand it.” (Active and transitive.)
And yet, a phrase like よく使った英語表現 (frequently-used English phrases), uses the active voice to emphasize the people using it, rather than the phrases themselves. If you transliterated the natural, passive English phrase “frequently-used,” it would become よく使われた instead, but that’s very unnatural Japanese.
The two languages just don’t really share logic about when a subject or object should be emphasized, or when active vs. passive voice is used.
Edit – Or how about 届く? In English, we’d say, “Did you get a notice from your bank?” But in Japanese, the same question would be 「銀行からお知らせが届いた？」, literally “Did a statement from your bank get delivered?” Technically this is still active in Japanese (since 届く has a meaning of “to be delivered” or “to arrive” and doesn’t take its passive form), but the choices between transitive vs. intransitive and subject vs. object are reversed. Regardless, if I were to translate it, I’d probably go with “Did you get a notice …” to reflect the more natural wording in each language.