She confided her troubles to him.

Literal

She [topic-は] him [to-に] worry [object-を] confided.

打ち明ける literally combines 打つ ('to strike') and 開ける ('to open') — 'to break open and reveal,' used metaphorically for confiding inner thoughts or feelings. Here the confided thing is 悩み ('worry, distress'), the noun form of 悩む ('be troubled, worry'). The に on 彼 marks the listener.