The post hoc fallacy is the mistake of assuming that because one thing happened after another, the first thing caused the second. Here is a textbook illustration:
"I had been doing pretty poorly this season. Then my girlfriend gave me these neon laces for my spikes and I won my next three races. Those laces must be good luck. If I keep wearing them I can't help but win!"
Nothing about the laces affected the race times. The runner improved — through training, form, better conditions, ordinary variation — and then reached backward for a cause that happened to be nearby in time.
It is one of the most common reasoning errors there is, and lucky socks are only the mildest version of it.