You are not alone if you commonly confuse “affect” and “effect.” These two terms were confused in print as early as 1494. The key to correct usage here is to determine whether the term is being used as a noun or verb, and to discern the intended meaning.
“Affect” is usually used as a verb. (I think of the “a” in “affect” standing for “active verb.”) To “affect” is to “influence”:
The moon affects the tides.
“Effect” is usually used as a noun, and it means “outcome or result”:
Inflation is one of the effects of war.
Brackish water has negative effects on certain vegetation.
Finally—to the horror of many—“effect” can also be used as a verb to mean “to bring about,” as in the phrase “to effect a change,” while “affect” can be used as a noun (usually in psychology) to mean “conscious subjective emotion.” Such usages, though infrequent, highlight why you must be particularly careful to choose the correct term for the circumstances, keeping in mind both the intended meaning and the intended part of speech.
To master the difference between “affect” and “effect,” study up at the following fun websites: