While both affect and effect have a variety of meanings and uses, I am assuming we're looking at the more general confusion that happens when using the incorrect form in its usual context of causality. In this most usual usage, affect is always a verb and effect is a always a noun.
Examples:
"State economists say the governor's new tariffs are affecting recent unemployment numbers."
"State economists say the governor's new tariffs are having an effect on the job market."
If you simply remember: If it affects the situation, it has an effect on its outcome. This will get you through about 90% of common mistakes with these homonyms.
In a broader sense, this can still sometimes get confusing because both have a few cases where they can be used as the other's usual part of speech. The most common of these would be effect as a verb: "Only you can effect change in our community." In this nuanced case, it is saying only you can "take actions" to produce a change, rather than saying you are directly impacting the change, such as with the above examples where the tariffs are directly responsible in some capacity for the State's job numbers.
So, if it isn't a direct causal relationship but more of you being a vessel for the effect, then effect would be the verb in that situation. Other exceptions are similarly specific, so you just have to check if it doesn't seem to fit the bill of causality.