She tried to keep her distance from him.

Literal

She [topic-は] him [to-に] not-approach [in-order-to-ようにしよう] tried-to-do.

A multi-layer stack of grammatical patterns. 近づかない (negative of 近づく 'approach') → 近づかないようにする ('try/take care not to approach') → 近づかないようにしよう (volitional, 'let me try not to') → 近づかないようにしようとする ('try to take care not to approach') → ~した (past). Five layers: negative + ようにする + volitional + とする + past. A great example of how Japanese stacks auxiliaries; reading order is from inside out.