If I am having intrusive thoughts when meditating, it is really bad, what to do?
Accept the thoughts as manifestations of mind and go deeper. The practice of detaching from those thoughts is the practice of meditation, by and large.
If it happens during ritual, talk to your patron diety and ask them this: please make any intrusive negative thoughts null and void for the entirety of this ritual. May they have no effect on the outcome. (Then go into ritual).
Remember they are just products of a mental illness, and it doesn’t show your true values and intentions. The Spirits understand and know what is really YOUR thoughts vs the shadow thoughts.
I would also tell Them if you haven’t already that you struggle with intrusive thoughts.