"Affect", in the example you've given, means to influence or produce an effect on something. In normal usage it is always a verb; it has a noun meaning only as a term used in psychology. In contrast, "effect" is most often used as a noun.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.