Looking at this, it seems that when the word 何 is used with the で particle, it roughly translates into "by means of what" or "in what context." Personally, that sounds like asking "how". Is this assumption correct? Or can it change based on situation? Also, would it be appropriate to add の/ん だ/です to the end of sentences that use this combination (since it seems that an explanation is being asked.)
Would a sentence like this be correct?: 何で医者になったの? (How did you become a doctor?)
Thanks!