David Evans's answer covers the use of these two words in everyday English and in 99% of cases:
affect = verb
effect =noun.
When something affects something else, it has an effect on it. Or see David's answer for more examples.
'Effect' can be verb, but it is fairly unusual. We occasionally use it in certain collocations, such as 'to effect a change'. It means to bring about or bring into effect. Unless you are a very advanced user of English, you probably won't need to use 'effect' as a verb.
'Affect' is never a noun in ordinary English. It has a very specialised academic meaning in psychology and some other disciplines, but few people are aware of this usage. You can almost certainly forget about 'affect' as a noun, unless you happen to be studying psychology, philosophy or psycholinguistics.