。
She spent most of her life caring for the poor.
Literal
She [topic-は] life [possessive-の] most-of [object-を] poor people [possessive-の] care [object-を] doing [in order to-ために] spent.
The structure nests a purpose clause inside a larger sentence. ために marks the purpose — 'in order to care for poor people' — while 人生のほとんどを is the object of 費やした ('spent'). The verb 費やす (ついやす) means 'to spend' in the sense of investing time, effort, or resources, and is more literary than the everyday 使う. The compound 世話をする ('to take care of') is a set phrase covering a wide range of caregiving.