She used margarine instead of butter.

Literal

She [topic-は] butter [of-の] place-of margarine [object-を] used.

~の代わりに ('instead of, in place of') is built on 代わり ('substitute, replacement'), the noun form of the verb 代わる ('to replace'). The pattern is N1の代わりにN2 — 'instead of N1, N2 (will do).' Margarine arrived in Japan as a wartime butter substitute and stayed; even now it's slightly cheaper than butter and a common pantry staple in Japanese households. The verb 使う ('to use') applies broadly across cooking, tools, language, and money.