。
She couldn't help but realize that health is important.
Literal
She [topic-は] health [subject-が] important [quotative-と] cannot-help-but-think did-not-do.
The headliner is ~ざるを得ない, the literary double-negative meaning 'cannot help but / have no choice but to.' Built from the classical negative ~ず (in its attributive form ざる) plus を得ない ('cannot obtain'), so literally 'cannot obtain not-doing.' Formal and emphatic; in everyday speech you'd more often hear ~するしかない or ~しないわけにはいかない. The polite past ~えませんでした puts the construction in the register of formal narration ('she came to that conclusion'). Stack on top: 思う takes its content with the quotative と, and 健康が大切 uses が because 大切 (a な-adjective) takes its subject with が in this kind of evaluative claim.