I've been thinking about how unhappiness works.
In the default mode of thinking, first unpleasant feelings arise. Unpleasant feelings cause you to search for or invent a reason to explain the unpleasant feelings. This explanation constitutes a confabulation because the feelings happened first and the explanation happened second.
This confabulation may happen consciously or unconsciously. I think for most people the confabulation happens below the level of awareness. If the confabulation happens below the level of awareness then it is possible for the feeling and the explanation to reach awareness simultaneously—or even for the explanation to reach conscious awareness before the feeling. It is perfectly reasonabe (even though it's wrong) to conclude that the explanation caussed the feeling and not the other way around.
If you conclude that the explanation caused the feeling then what you'll probably do is try to fix your confabulated problem. But that will never cure you of suffering because the thing you're trying to cure is not the cause of your suffering.
How do you get off the wheel of samsara? By breaking the habit of confabulating explanations in the first place.