Yōga Sūtras
Yōga Sūtra 2.33
vitarkabādhanē pratipakṣabhāvanam।
When troubled by illogical thoughts or over thinking, counter it by opposing thoughts.