She [topic-は] sleeping before [to-に] light [object-を] turned-off.
寝る前に ('before sleeping') uses the pattern [verb plain form]+前に to mark temporal sequence — the action of turning off the light happens before sleeping. 明かりを消す ('to turn off the light') uses 消す (けす, 'to extinguish, to turn off').