She was in despair after her husband passed away.

Literal

She [topic-は] husband [subject-が] passed-away [then-て] was-in-despair.

絶望する ('to despair') is a strong Sino-Japanese compound. 亡くなって is the euphemistic te-form of 亡くなる.