She makes a living by teaching.

Literal

She [topic-は] teach-(thing) [by means of-で] livelihood [object-を] is-making-up.

ことで ('by means of doing X') uses こと to nominalize a verb-phrase, then で marks it as the means. The same pattern works for any 'by doing' construction: 走ることで体力をつける ('build stamina by running'). Where alternative phrasings like 教師をして ('working as a teacher') or 教師として ('as a teacher') foreground the role, the ことで version foregrounds the activity itself (teaching) — semantically the same livelihood, framed differently.