Both of the other answers are correct. "Affect" is usually a transitive verb, meaning it needs an object: "He affected how I thought about the matter." "Effect" is commonly seen as both a verb (as in "to effect a change," that is, to make a change) and a noun ("cause and effect").
However, in rare instances, "affect" can also serve as a noun, usually meaning a feeling or emotion: "She studies the role of affect in politics," meaning she studies how feelings or emotions affect politics. Again, not common outside certain contexts, but still good to know.