ספר המדות Improper Thoughts / Part II · יא
Sefer HaMiddot 803
יא. לִפְעָמִים עוֹלֶה בְּמַחֲשַׁבְתּוֹ שֶׁל אָדָם, וְחוֹשֵׁב בְּאֵיזֶהוּ חוֹלַאַת, וְזֶה סִבָּה מֵאֵת הַשֵּׁם יִתְבָּרַךְ, כְּדֵי שֶׁיִּזְכּר אֶת עַצְמוֹ לְתַקֵּן הַמַּחֲשָׁבָה רָעָה, שֶׁהַחוֹלַאַת בָּאָה עַל־יָדוֹ.
11. Sometimes, it will arise in a person's thought that he will think about some illness. This is caused by Hashem, may He be Blessed, in order that he should remind himself to fix the evil thought which is the cause of that illness.