Uses of para: looking ahead
Every use of para has an end point in view. If you can rephrase with “in order to”, “intended for”, “towards” or “by (a deadline)”, it is para.
Uses of por: cause and the way through
Por covers more ground. Its uses fall into two families: the reason behind something (because of, on behalf of), and the path or medium it travels through (through, along, by, per, in exchange for).
“Thank you for” is always por: gracias por todo (thanks for everything). You are thanking someone because of something they did, so it is a cause, not a goal.
Same sentence, two meanings
Swapping por and para in these sentences keeps the grammar correct but changes what you mean. They are the clearest way to feel the difference between the two.
Fixed expressions with por
Many everyday phrases are built with por. Learn them as whole units, the way you learned por favor.
Para has fewer fixed phrases; the most useful are para siempre (forever), para nada (not at all) and ¿para qué? (what for?). Compare ¿por qué? (why?, asking for a cause) with ¿para qué? (what for?, asking for a purpose). Question words carry an accent, as explained in stress and written accents.
Check yourself
Pick por or para. The reason appears once you choose.