These words are often confused because of their related meanings but differing spellings.
Affect is a verb meaning “to influence.”
Effect can be both a verb and a noun. Its noun form is related to affect. (Its verb form, meaning “to accomplish” or “to put into operation,” has a different meaning and usage altogether.) In its noun form, an effect is the result of someone or something that is affecting another person or thing.
Here is an example:
Smoking affects health. The effect is lung cancer.
Affect is the verb causing the influence or change (on health). The effect is the result (lung cancer).