Kitzur Likutei Moharan I, 72:6
There are people who have sexual thoughts, God forbid, and these overpower them especially at the time of prayer. And there are those who, when they stand to pray, imaginings come before them, as though the image of an idol stands before them, or other evil imaginings, and these confuse them very much at the time of prayer, and they suffer greatly from them. They want to struggle very hard to remove these thoughts from their minds, and they toss their heads this way and that. But know that the more they suffer and the more they struggle to remove them from their minds, the more these confusions and evil imaginings grow stronger and stronger. For such is their nature: the more one thinks about them in order to push them away, the more they cling after him. Therefore the main advice is not to pay attention to them at all, and not to care at all that these imaginings and thoughts stand before him, and not to listen to them at all. Rather, he should do his own task in what he is occupied with, whether Torah or prayer or business, and not pay attention to them at all, and not look back to see whether they have left him, but do his own task in what he is occupied with, and by this they will leave him by themselves. But this is only advice for the moment. The main thing is that he must sanctify and purify his body and go to the true tzaddikim, and they will teach him the ways of truth, and then they will leave him completely.
View original Hebrew
יֵשׁ בְּנֵי אָדָם שֶׁיֵּשׁ לָהֶם הִרְהוּרֵי נִיאוּף חַס וְשָׁלוֹם וּמִתְגַּבְּרִים עֲלֵיהֶם בְּיוֹתֵר בִּשְׁעַת הַתְּפִילָּה, וְיֵשׁ שֶׁבְּשָׁעָה שֶׁעוֹמֵד לְהִתְפַּלֵּל מִזְדַּמְּנִים לְפָנָיו דִּמְיוֹנוֹת, כְּאִלּוּ עוֹמֵד לְפָנָיו דְּמוּת עֲבוֹדָה זָרָה אוֹ שְׁאָר דִּמְיוֹנִים רָעִים, וּמְבַלְבְּלִים אוֹתָם מְאד בִּשְׁעַת הַתְּפִילָּה וְיֵשׁ לָהֶם יִסּוּרִים גְּדוֹלִים מֵהֶם. וְרוֹצִים לְהִתְגַּבֵּר מְאד לְהַעֲבִיר אוֹתָם הַמַּחֲשָׁבוֹת מִדַּעְתָּם וְזוֹרְקִים ראשָׁם הֵנָּה וָהֵנָּה, אֲבָל דַּע שֶׁכָּל מַה שֶּׁיֵּשׁ לָהֶם יִסּוּרִים יוֹתֵר וְכָל מַה שֶּׁהֵם מִתְגַּבְּרִים בְּיוֹתֵר לְהַעֲבִירָם מִדַּעְתָּם, אֲזַי אֵלּוּ הַבִּלְבּוּלִים וְהַדִּמְיוֹנוֹת הָרָעִים מִתְגַּבְּרִים יוֹתֵר וְיוֹתֵר. כִּי כָּךְ טִבְעָם שֶׁכָּל מַה שֶּׁחוֹשְׁבִים עֲלֵיהֶם יוֹתֵר לִדְחוֹתָם הֵם כְּרוּכִים אַחֲרָיו יוֹתֵר, עַל כֵּן עִקַּר הָעֵצָה לִבְלִי לְהַשְׁגִּיחַ עֲלֵיהֶם כְּלָל וְלא יִכְפַּת לֵהּ כְּלָל מַה שֶּׁעוֹמְדִים לְפָנָיו אֵלּוּ הַדִּמְיוֹנוֹת וְהַהִרְהוּרִים וְלא יִשְׁמַע אוֹתָם כְּלָל, רַק יַעֲשֶׂה אֶת שֶׁלּוֹ בַּמֶּה שֶׁהוּא עוֹסֵק בְּתוֹרָה אוֹ תְּפִילָּה אוֹ מַשָׂא וּמַתָּן, וְלא יַשְׁגִּיחַ עֲלֵיהֶם כְּלָל וְלא יַבִּיט לְאַחֲרָיו אִם נִסְתַּלְּקוּ מִמֶּנּוּ רַק יַעֲשֶׂה אֶת שֶׁלּוֹ בַּמֶּה שֶׁהוּא עוֹסֵק וּבָזֶה יִסְתַּלְּקוּ מִמֶּנּוּ מִמֵּילָא. אַךְ זֶה הוּא רַק עֵצָה לְפִי שָׁעָה וְהָעִקָּר שֶׁצָּרִיךְ לְקַדֵּשׁ וּלְטַהֵר גּוּפוֹ וְיֵלֵךְ אֵצֶל צַדִּיקֵי אֱמֶת וְיוֹרוּ לוֹ דַּרְכֵי הָאֱמֶת אָז יִסְתַּלְּקוּ מֵעָלָיו בְּתַכְלִיתRead this passage within Part I · Torah 72, in its full context