на isn't used very often to mean "for" - the only example I can think of is фото на документы and it's just that the logic of the Russian is different, focusing on where the photos go ("on the documents") rather than what their purpose is ("for documents")
за is used for some specific uses of "for" - paying for something (платить за), receiving punishment for something (его посадили за убийство), substituting for someone else (like in iCake's example above), asking "who do you take me for?" (ты меня за кого принимаешь) and so on..
In general I think it makes sense to memorize most of these phrases rather than try to translate words like "for" since this word has so many different uses in English
Ie. "For example" например
"prepare for" готовиться к
"look/search for" искать
"this instrument is used for measuring temperature" - этот инструмент используется для измерения температуры