Generally speaking, affect is a verb and effect is a noun. When you affect something, you produce an effect on it. Even in the passive voice, something would beaffected, not effected.
To affect something is to change or influence it, To effect something is a rather formal way of saying `to make it happen'. Confusingly, either may produce an 'effect' or result. ('An affect' is a technical term in psychology.)
The stability of the wall was affected by passing lorries.
The demolition of the wall was effected by the detonation of a charge of dynamite.
The dynamite did not just 'affect' (influence) the demolition of the wall: it caused it.