。
She studied hard so as not to fail the exam.
Literal
She [topic-は] exam [target-に] not-fail [so as not to-ないように] with-all-her-might studied.
The pattern [verb-ない]+ように expresses a negative purpose — 'so as not to X / in order not to X.' It's the negative counterpart of the positive purpose ように ('so that X happens'), and pairs naturally with verbs of effort, caution, and precaution. 一生懸命 (literally 'stake one's whole life') is a four-character compound used adverbially for 'wholeheartedly / with all one's might' — extremely common in everyday speech for describing effort, especially in school, work, and sports contexts. The bare 一生懸命 and the explicit adverbial form 一生懸命に are both accepted with no real difference in meaning.