Koheles opens with the words הֲבֵל הֲבָלִים אָמַר )2:1( קֹהֶלֶת הֲבֵל הֲבָלִים הַכֹּל הָבֶל The Rebbe R' Bunim offered a novel reading of this pasuk that is quite sharp: There is the hevel peh, the pure breath of Torah and tefillah, and there are the havalim, the mere vapor of Olam Hazeh. If one mixes the hevel of his Torah and tefillah with the havalim of Olam Hazeh, then הכל הבל-everything becomes hevel.
What, then, is the remedy for someone who has allowed Olam Hazeh to enter his learning and davening? How can he separate the two? When impurities are mixed into flour, we place the mixture in a sifter and shake it up and down until the flour separates from the waste. This is how we remove impurities from our avodas Hashem: we dance on Simchas Torah. As we leap up and down in honor of the Torah, we shake the impurities from our hearts and minds, leaving ourselves with the clarity to learn and daven without foreign thoughts.