Affect is a verb, and effect can be a verb or a noun.
As verbs, affect and effect have very different meanings.
To affect is to influence, to “have an effect on, make a difference to” (temperature affects the viscosity of a syrup).
To effect is to “cause to happen, bring about” (to effect a change). Incidentally, affect has another meaning: to “pretend to have or feel” (he affected a British accent when he returned home after a one-year stay in London).