。
She tried to write down everything the teacher said.
Literal
She [topic-は] teacher [possessive-の] says words [object-を] all write-down [tried to-ようとした].
先生の言う言葉 is a relative clause: 'the words the teacher says,' where の replaces が inside the relative clause. 書き留める is a compound verb — 書く (write) + 留める (fix in place) = 'to write down, to note.' The ~ようとした construction (volitional form + とする) means 'tried to,' describing the attempt itself — implying effort without guaranteeing success.