I was going to decide which subject to study at the university level. I once had this thought: What if while studying this subject, I discover that Islam is not scientifically logical and I leave the religion? Based on this, I began to worry that this might happen to me and that I could leave Islam. Is this an act of doubt which leads to Kufr (disbelief), as I thought: what if I discover that Islam is not logical? Note that this was not merely Waswaas (devilish whisperings) as I actually acted upon it by frowning and asking people whether I should take the subject despite my fears. It does not matter what I wanted to study. I wanted to study Artificial Intellligence, and I feared that I would discover some robot that would be better than the creation of Allaah, which would make me stop believing in Islam.
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 is His slave and Messenger.
First of all, you should know that reason does not contradict Islam at all, and imagining such a thing is nothing but an illusion.
This is common sense because the creator of the mind and reason is Allah, and the One Who revealed this religion is Allah, and what is from Allah will never contradict itself.
If there is anything that appears contradictory, then this is either because what our mind thinks is not true or that what people think to be from Islam is not from Islam in reality.
Indeed, Shaykh Ibn Taymiyyah wrote a big book, which he entitled Dar’ Ta`aarudh Al-`Aql wan-Naql (Refuting the Contradiction of Reason and Text).
If we presume that some machines are more intelligent than man, then this does not undermine religion at all. Rather, these machines are man-made, and the fact that man was enabled to manufacture them is a favor from Allah upon him. So how can something that requires being grateful to Allah lead to disbelieving in Him?
This is with regard to the confusion that you have.
As for what you feel, it is nothing but Waswaas (obsessive doubts); and the proof is that you hate it and repel it. Hence, what you feel within yourself does not affect the validity of your faith, and it does not harm you.
We advise you to study hard and learn the rulings of your religion and not pay attention to these doubts or get carried away with them, because getting carried away with them leads to a great evil.
Allah knows best.
You can search for fatwa through many choices