So if what you’re trying to say someone or something was impacted by something else, you say “affected”.
Also as a general rule of thumb “effected” while grammatically correct is rarely ever used in colloquial talk in the context of what it means which is executed or produced. So people almost always mean “affected” when they make this mistake.