"How do I know if I committed shirk (making partners with Allah in worship)? And how would you repent for it?"
Note: There is no god beside Allah. Whoever makes partners with Allah - they have commited shirk (associating parnters with Allah)
What to Do About Shaytan?
A question comes from one of our younger brothers in Islam. He states:
I am 16 years old and have committed a big sin. I am really scared, please pray for me.
I was listening to the 99 Names of Allah and I had a "shirk" (partners with Allah) thought for a second. I do not believe in it (the thought I had) but it did come to me. I guess I had a doubt for a second about Allah.
I know this is unforgiveable sin, but I don't know if it I did this, because I really do believe in Allah.
So, my question is: "How do you know if you actually committed shirk with a brief doubt in your mind but you do really believe in Allah? And if so, how do you repent for it and be sure Allah has forgiven you?"
I read your question and if I understood it correctly, it appears that the problem is not you, as much as it is shayton. The shayton has come to you and made a statement of doubt in your ear and wants you to think that it came from you. However, it was only his statement and not from you.
Therefore, consider this a test from Allah and you are stronger due to the test. You should try to avoid listening to shayton as much as you can, but remember Allah will not hold you responsible for what you are not able to control.
Allah tells us about this in surah Baqarah the Quran:
"Laa yu kali fullahu nafsan illa wus'aha laha makasabat wa alayha maktasabat"
[Allah does not hold someone responsible for what they cannot bear. For this person is whatever he has earned (of good) and against him is whatever he has earned (of evil)]. 2:286
Do not worry that Allah is not going to forgive you about this incident. I would do as the prophet, peace be upon him told us to do, seek refuge with Allah and leave that kind of thinking, inshallah.
Shaytan is our open enemy. He hates us and wants to take us all to Hell. He has no real power, only the "wiswas" or "whispering."
Say, "Authobillah minish-shayton irajeem."
[Explanation of "Why is the Devil Called Shaytan?" click here]