。
She opened the window to clear the smell out of the kitchen.
Literal
She [topic-は] kitchen [from-から] smell [object-を] erase [in-order-to-ために] window [object-を] opened.
~ために is the purpose marker 'in order to / for the purpose of,' attached here to the dictionary form 消す ('to erase, extinguish, get rid of'). から marks the source of removal ('from the kitchen'). The structure is: [purpose clause]ために + [main action clause]. 消す applied to a smell is the standard verbal collocation for 'eliminate / get rid of' — works with light, fire, sound, or smell, not just literal erasing.