Misunderstanding the link between our actions and consequences could be what makes giving up harmful habits so difficult, study shows.