AffectIn your use case scenario:
Affect is a verb: "Doing X will affect Y."
Effect is a noun: "The effect of doing X can easily be seen in the change in Y."
An easy exercise for learning the different use cases would be to replace these homophones in the following way to see if they make sense:
Replace "affect" with "cause a change in": Doing X will cause a change in Y. Replace "effect" with "result": "The result of doing X can easily be seen in the change in Y."