To take the Lord's name in vain was for the Israelite people to take the name of God, as His people and lived contrary to the way He had commanded. Imagine a wife taking her husband's name, being known as his, and then cheating on him. She took his name in vain if she was not going to live within the vows of marriage.
The third commandment is not about putting "Jesus" or "God" before a curse word (though you probably shouldn't do that) it's about living a life that stands in opposition to being a child of God. You can read [this book}(https://www.amazon.com/Bearing-Gods-Name-Sinai-Matters/dp/0830852697) on the subject.