The fallacy of post hoc ergo propter hoc ("after this, therefore because of this") occurs when an arguer concludes that because one event followed another, therefore the latter event was caused by the former.
Here is an example:

Fran: "Jane, you need to pay for a new transmission on my car." Jane: "Why on earth?" Fran: "Because you borrowed by car last week to pick up you sister, and now the transmission is shot."
The problem here is that the transmission failure may have resulted from a long history of wear and may have nothing to do with Jane using the car one time. The occurrence of the failure shortly after Jane's using the vehicle may be just coincidence.
Here is another example:
Miguel: "I always feel sick after eating grandma's sweet potato pies. I think I must be allergic to something in them."
Michelle: "Have you considered that it's because you always eat four or five of them?"
Michelle is pointing out to Miquel that he may have committed the fallacy of post hoc ergo propter hoc. His over-indulgence needs to be considered an alternative cause.
A general template for this fallacy is:
1. A happened shortly before B.
2. Therefore, A caused B.
Image credit: Vector Portal under CC BY 4.0