To affect something is to exert influence on it; to effect something is to make it happen. Effect can also be a noun meaning a result or outcome. Here are examples of the correct use of each word:
"How will our earnings report affect the price of the company's stock?"
"What effect will the earnings report have on the price of the company's stock?"
"What can we do to effect a smooth transition?"