A general rule of thumb is that affect is usually used as a verb, and effect is usually used as a noun. As with other parts of speech, when in doubt try to replace it with a word you know the function of (i.e. clearly a verb, or clearly a noun); if it still makes sense then you know which one to use.
Example: “The arrow affected the aardvark.” “The arrow injured the aardvark.” Injured makes sense here, so you need the verb form.
Effect is a noun, so try to replace it with another noun, e.g. “outcome.”
Example: “The outcome was eye-popping.” If you place these substitute words in the other sentences they wouldn’t make sense.
I hope that helps! If you’re confused, just think of the aardvarks…