The Talmud in Sotah (2a) cites Rebbi who says, "Why does the portion of Nazir (the one who is forbidden to consume wine) follow the portion of Sotah (the wife suspected of adultery)? To teach you that anyone who sees a Sotah in her degradation should separate himself from wine. [My Translation - See Below For Actual Text]
The Ba'al Shem Tov reportedly commented: Why does Rebbi only charge the one who sees a Sotah to separate from wine? Shouldn't we all, every reader of the Chumash, respond to the portion of Sotah? Rather it is specifically the one who sees not the reader of the Chumash. The person who actually witnesses the Sotah in her degradation was put in that situation to learn some sort of message. Rebbi says that the person's response should be to separate from alcoholic beverages.
I am not well versed in Chassidic teachings, but I believe that this is one source to the idea presented in the question.
אמרו בפ"ק דסוטה (ב.) תניא רבי אומר למה נסמכה פרשת נזיר לפרשת סוטה לומר לך שכל הרואה סוטה בקלקולה יזיר עצמו מן היין