I have constant doubts about my faith, so how does someone know if he is a Muslim or a hypocrite?

Shaykh Muḥammad Bāzmūl:

This is an indication of having intrusive thoughts, the third type of obsession, and the way to treat it is to say: I seek refuge with Allāh from the accursed Shayṭān, whenever these thoughts occur, and to invoke Allāh and say: “Say, Allāh, I beseech you! Owner of all dominion, you give authority to whomever you will...” and so on. Also, the person should not continue with such thoughts and busy himself with the remembrance of Allāh and contemplation of the blessings of Allāh. He should keep himself busy and shun these thoughts and hopefully Allāh will repel from him the evil plot of the Shayṭān. The Shayṭān only creates these faith-related obsessions because he knows that this person has some good in his heart. There is an analogy used by the scholars to describe this phenomenon.

It says that the Shayṭān only approaches hearts filled with faith and (unclear). Have you ever seen a thief robbing empty ruins – dilapidated dwellings that contain nothing? The same goes for the Shayṭān. He only approaches thriving hearts. So I mean, this is evidence of faith but you must not persist in it, and it does not behove a Muslim to persist in it, and he should stop and busy himself with the remembrance of Allāh and seeking refuge from the accursed Shayṭān, as well as contemplating Allāh’s blessings, and rid himself of this type of thinking.