She decided to keep a diary.

Literal

She [topic-は] diary [object-を] keep [nominalizer-こと] [to-に] decided.

~ことに決める is a fixed pattern for personal decisions: 'decide to do ~.' The こと nominalizes the action, and に marks the decision as directed at that nominalized event. 日記をつける ('keep a diary') is a stock collocation — つける meaning 'log, record.'