Simply put, effect is a noun and affect is a verb.
You will use the word effect to name a result of something that has caused a change. If you are writing an essay that analyzes a scene, event or character's action, and you would like to remark on the effect this has on the other characters or the events to follow, then, as I have just done, you use the word effect. Here's an example using Shakespeare's play Macbeth:
The effect of Lady Macbeth's part in the murder of Duncan does not come back to haunt her until the final Act of the play, when she has clearly become unhinged, sleepwalking and attempting to wash her hands of her guilt in the deed.
Someone or something can be affected. In this case, they or it have/has been changed by some event or other person. Here's an example, also using Macbeth:
Lady Macbeth is very affected by her part in the murder of Duncan. Though she seems strong and without remorse in the early acts, she enters Act V as a broken and lost woman.
So, remember -- an effect is a thing (noun); and someone or something must be affect --ed, an action (verb).
affect is a verb while effect isa noun
for example: Smoking can affect your health.
Smoking can have a bad effect on your health.