Deu 5:11 Thou shalt not take the name of the LORD thy God in vain: for the LORD will not hold him guiltless that taketh his name in vain.
This warning is often taken to mean “do not use/speak the name of God by swearing”. Vain then means to curse or swear disrespectfully.
The context however is the Covenant between the Lord their God and the children of Israel. In that covenant they pledged by oath to TAKE that covenant between themselves (to be literally married), OBEY His commands, and worship Him; and in turn the Lord would bless them like no other people on earth.
To take his name in vain simply means to call themselves God’s people but not obey him or keep their part of the Covenant. VAIN means FALSELY. It’s hypocrisy, it’s a lie.
Here is the NT equivalent spoken of professing Christians:
2Ti 3:1ff This know also, that in the last days perilous times shall come. For men shall be lovers of their own selves, covetous, boasters, proud, blasphemers, disobedient to parents, unthankful, unholy, Without natural affection, trucebreakers, false accusers, incontinent, fierce, despisers of those that are good, Traitors, heady, highminded, lovers of pleasures more than lovers of God; Having a FORM OF GODLINESS, but DENYING THE POWER THEREOF (vain/fruitless): from such turn away.