Effect and Affect are similar words, with subtly different, importantly different meanings.
The way to (almost) always get the right word (any word) is first to understand the meaning of the word you are using, and second, to actually speak it, either out loud or silently.
Once you understand the words thoroughly, as long as your brain is working, you should never get them wrong, as long as you are concentrating on the task at hand. Until that time, you need to know the words you have problems with, and pay extra attention to them. Of course, that depends on someone telling you that you got it wrong, so you can fix it. This is the reason you need a pedantic editor!
Using the wrong word is bad for the writer, bad for the editor and a reflection on the publication, whether we like it or not – and we definitely don’t like it!