Before a habit-pattern arises in experience, we can practice forming the intention not to be take over by it.
After the experience, we can remember that the experience was just an experience, and reflect on whether we were able to maintain our intention in the face of it.
But during the experience itself, we have an opportunity to look deeply into the nature of the experience itself, to see its true nature.
Being able to be present and intentional in the experience is stability (shamatha). Looking deeply to see the true nature of what arises results in insight (vipashyana).