The Rebbe advises that the best way to handle sudden doubts is to ignore them rather than engage in debate, as they stem from external influences. He emphasizes replacing negative thoughts with Torah study and avoiding idle matters. Strengthening joy in serving Hashem, giving tzedakah, and positively influencing others will help dispel these doubts
https://www.torahrecordings.com/rebbe/igroskodesh/014/005/5170