These two words trip up even experienced writers, mostly because they sound alike but play different grammatical roles.
A verb meaning to influence or change something.
A noun meaning the result or outcome of a change.
Quick way to remember
If you can replace it with "influence," you want "affect." If you can replace it with "result," you want "effect."