So I did not commit it then? I didn't say it publically I just heard it in my mind as a thought. What should I do then? Just ignore it if it comes back and keep reading the bible and praying?
No, I believe you absolutely no way committed the unpardonable sin. I believe the devil and his demons can certainly put thoughts into our minds. I doubt that thought was even yours. Now one can reject or embrace such thoughts, but obviously you don't want do embrace them.
What to do about it? First, since you mentioned OCD I would look on the net and see if you have symptoms of that. One bad thought in your head, of course, would not be enough. If there seems to be an OCD pattern, well, personally I would avoid a psychiatrist and their meds. Not saying they never have helped anyone. On the other hand they have never cured a single disease of any kind and the tales of harm done by their prescriptions can be horrifying. That's my opinion and observation, but of course you have to decide for yourself.
You might want to check out Dr. Daniel Amen. He is a psychiatrist who tries to avoid meds and has done over 60 thousand brain scans. In one of his books, or Youtube vids, I'd guess he has offered some advice re OCD, if you have it.
In the meantime, anytime, when those thoughts come I would say don't do what a lot of people do and say "I rebuke you Satan!" Nowhere in the Bible are we ever told to talk to him at all. When an archangel was disputing over Moses' body with the devil, the angel said, "May YHWH" aka God "rebuke you". That was in a face to face confrontation however.
There are many kinds of spiritual warfare. You are going to be in a spiritual battle, one way or another, most if not all days of your life. That's the norm. We are told to be overcomers, conquerors. "The troubles of the righteous are many, but" we are told that our Heavenly Father delivers us out of them all.
Praise is a great form of spiritual warfare. "YHWH inhabits the praises of His people Israel...." (we are told to be grafted into Israel in the "New" Testament.) Where YHWH, aka God, is, the devil ain't! When you get a thought like that your can think or say things like, "The Bible is the true and living Word of the Almighty Creator" which I believe it is, in its original Hebrew form.
Or you can say things like "He Who began a good work in me will be faithful to complete it....Greater is Yahushua" aka Jesus "in me than he" aka the devil "who is in the world."
Saying the Lord's Prayer is very helpful to many people. Actually, since it says "Give us the
this day our daily bread" it seems we need to say it every day anyway. Learn the 23rd Psalm and say it. Ditto the 91st Psalm.
Sing praise songs! Read the stories of how David's singing to Saul caused the monarch's evil spirits to take off, how Silas and Paul were miraculously released from prison while singing to the Lord, how Jehoshaphat had his priests to simply carry the ark and sing praise songs when various armies came against Israel, vastly outnumbering his people.
How often does the Almighty want you talking to Him, singing to Him, thinking about Him? Mostly all the time. "He who keeps His mind stayed on me I will keep in perfect peace."
Praying for you to find the peace there is in spiritual warfare.