Ergo Propter Hoc
crows early in the morning.
rises immediately after the rooster crows.
Event A caused Event B
Because the rooster crowed right before the sun rose, the rooster caused the sun to rise.
Post Hoc Ergo Propter Hoc
States A occurred, then B occurred. Therefore, A caused B. When B is undesirable, this pattern is a lot of times extended in reverse: Avoiding A will prevent B.
The fallacy lies in coming to a conclusion based solely on the order of events, instead of taking into account other factors that might rule out the connection between the two.