She got hurt in a traffic accident.

Literal

She [topic-は] traffic-accident [by-で] injury [object-を] did.

けがをする ('to get injured, be hurt') is built like 病気をする ('get sick'), where a noun for an undesirable state combines with する. 怪我 (often written in hiragana けが for readability) is a general-purpose word for injury — bruises, cuts, sprains, broken bones. Compare with 負傷する ('be wounded'), which sounds more medical or formal. The simple frame 事故でけがをする is one of the most common ways Japanese describes accident-related injury.