One is the cause of his own troubles:
The verse states “The foolishness of man strays him from the correct path and his heart is angered with Hashem.” This means as follows: All the evil that befalls man, he himself brought it upon himself. For example, if one was chasing after extravagances and a tragedy occurred in the process, he himself is responsible, as he could have sufficed with the basics. Likewise, if he desires to be wealthy and overexerts himself in making a vessel for Parnasa, he is responsible for any negative occurrences that happen in his over exertion. One can likewise apply the same concept towards Machshavos Zaros during Torah and prayer. Majority of disturbing thoughts during Torah and prayer are instigated by the person himself. For example, if thoughts of Parnasa trouble a person during his Torah and Avoda, it is due to his own negligence, as if he would contemplate that the blessing for Parnasa comes from Hashem, he would not at all be troubled by this.
 Hemshech Mayim Rabim of Rebbe Maharash 5636, brought in Mamar Basi Legani Yud Shevat 5730 15 [Mugah, printed in Melukat 4 p. 148]
 Mishlei 19/3
 This later relation regarding Machshavos Zaros is an insertion of the Rebbe in the Mamar ibid based on the Mamar of theb Rebbe Maharash