If you have thoughts of shirk but you don’t actually believe in them would you have committed a sin?
And what I mean by having thoughts of shirk is you, yourself bringing those thoughts to mind (not waswas or OCD thoughts).
Islam Stack Exchange is a question and answer site for Muslims, experts in Islam, and those interested in learning more about Islam. It only takes a minute to sign up.Sign up to join this community
These thoughts only won't make you kafir.But you must try to avoid them and do not do any action according to those thoughts.Whenever those thoughts come in your mind try to do something else.Keep your mind busy in any useful works or anything which makes you happy and positive.And a scholar told me if thoughts or doubts come in mind it's waswasa of shaytan and we should say "amantu billah". And ask Allah to help you.