Don't be too disheartened -- many native speakers don't know the difference either.
But the difference is very easy: "affect" is a verb, "effect" is a noun. So, "it affects me" (verb), but, "it has an effect on me" (noun) -- these two sentences mean the same.
You will often see native speakers using the wrong word. Unfortunately, in an exam, you're not allowed to make the same mistake. One of the difficult things about learning a foreign language is that you have to be better at it than native speakers.