All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
We have previously underlined in fatwas 18942 and 32619 that magic exists; it is real and has an effect.
The Muslim is obliged to believe in whatever has been authentically established in the divine revelation, i.e. the Quran and the authentic Sunnah of the Prophet, sallallaahu ‘alayhi wa sallam. He must render the divine revelation a judge over his mind and reasoning, not the other way around. In other words, the divine revelation must be made superior to reason; what is established by the divine revelation cannot be questioned by reason.
Your past questions show that you may be suffering from Waswasah (obsessive doubts). We advise you to repel such doubts and stop thinking about testing yourself by swearing by Allah. You bear no sin for what you feel as long as they are mere thoughts or an inner talk inside your head. The Prophet, sallallaahu ‘alayhi wa sallam, said, “Verily, Allah forgave my people the evil promptings which arise within their hearts as long as they do not speak about them or act upon them.” [Al-Bukhari and Muslim]
For more benefit, please refer to fatwa 199253.
Allah knows best.