How to stop using the Buddha's name in vain?

Some 30 years ago, I read a holy book and one of the passages that stuck in my mind was the verse "whoever uses God's name in profanity vain will go to hell."

I don't know why but this verse stuck in my mind. Whenever I thought of god, this verse would come to mind and I couldn't stop thinking of him in vain. I know it's silly but it's been a mental anguish.

I've been moving towards Buddhism and this problem just transferred over. When I think of the Buddha, I think of his name in vain now as well. It's never deliberate but I just get these intrusive thoughts. I just don't know how to stop these thoughts.