R. Chaim of Volozhin discusses divine supervision, human intention, and the effect of one's inner state on one's relationship to providence and blessing.
ולכן גם ר"ח לא שבטח על זכות קדושת תורתו ומעשיו המרובים. רק שידע ושיער בנפשו שזאת האמונה קבועה בלבו לאמיתה שאין עוד מלבדו יתב' שום כח כלל. והדביק עצמו בקדושת מחשבתו לבעל הכחות כולם אדון יחיד המלא כל עלמין ואין כאן שום שליטה ומציאות כח אחר כלל. לכן היה נכון לבו בטוח בזה שלא ישלטו עליו פעולות הכשפים הנמשכים מכחות המרכבה טמאה. ז"ש לא מסתייע' מילתיך אין עוד מלבדו כתיב: ובאמת הוא ענין גדול וסגולה נפלאה להסר ולבטל מעליו כל דינין ורצונות אחרים שלא יוכלו לשלוט בו ולא יעשו שום רושם כלל. כשהאדם קובע בלבו לאמר הלא ה' הוא האלקים האמתי ואין עוד מלבדו יתברך שום כח בעולם וכל העולמות כלל והכל מלא רק אחדותו הפשוט ית"ש. ומבטל בלבו ביטול גמור ואינו משגיח כלל על שום כח ורצון בעולם. ומשעבד ומדבק טוהר מחשבתו רק לאדון יחיד ב"ה. כן יספיק הוא יתב' בידו שממילא יתבטלו מעליו כל הכחות והרצונות שבעולם שלא יוכלו לפעול לו שום דבר כלל.
And for that reason even in the case of Rabbee Chaneena, it’s not that he relied on the merit of the holiness of his Torah or his [long history of] positive behaviors, but only that he intimately knew and measured in his soul-Neffesh, that this reliability was established in his heart/mind as being true: that other than Him (blessed be He) there is absolutely no other power at all. And he attached himself via the purity of his thoughts to the Master of All Powers, unique Lord who fills all worlds, and no other power here has any control, nor real power at all. For that reason, that his heart/mind was rightly certain about this—that actions of sorcery that drew on the powers of the impure Vehicle would have no control over him—this is why he stated: “Your effort will not succeed, for it is written ‘There is nothing but Him’”. And truthfully, this is a great matter and a wondrous treasure that takes him out of the realm of any other judgments and the desires of others, so that they can’t control him, nor make any impression at all. When a person fixes it in his heart/mind to state, that after all: • God-YHV”H is the true God-Elohi”m and there is no other power in the universe nor in all the worlds at all other than Him, and • Everything is filled only with His (blessed be His name) simple unity, and • He, in his heart/mind, completely nullifies all others, and does not attend to any power or will in the universe, and harnesses and adheres the purity of his thoughts only to the unique Lord (blessed is He), then He will make it happen for him, that in any case all of the powers and desires that are in the universe will be nullified from upon him, so that they are not able to affect him in any way at all.