Some people have often written affect while they wanted to write effect. This can completely change the intended meaning in the writing because:
Affect is a verb written to imply change or impact. When used in a sentence, it should be something like, “Excessive drinking will affect your judgement.”
Effect is a noun that usually refers to the result of the impact or changes created. For instance, we can say, “Poor infrastructure will have a bad effect on the economy.”