She was wearing sunglasses to protect her eyes from the sunlight.
Literal
She [topic-は] sunlight [from-から] eyes [object-を] protect [in order to-ために] sunglasses [object-を] was-wearing.
サングラスをかける uses かける ('hang, attach, apply') — the verb for putting on eyewear, including sunglasses, regular glasses, and goggles. Each garment type has its own wear-verb in Japanese (着る, はく, かぶる, する, かける).