Jews do not casually write any Name of God. This practice does not come from the commandment not to take the Lord's Name in vain, as many suppose. In Jewish thought, that commandment refers solely to oath-taking, and is a prohibition against swearing by God's Name falsely or frivolously (the word normally translated as "in vain" literally means "for falsehood").
Judaism does not prohibit writing the Name of God per se; it prohibits only erasing or defacing a Name of God. However, observant Jews avoid writing any Name of God casually because of the risk that the written Name might later be defaced, obliterated or destroyed accidentally or by one who does not know better.
The commandment not to erase or deface the name of God comes from Deut. 12:3. In that passage, the people are commanded that when they take over the promised land, they should destroy all things related to the idolatrous religions of that region, and should utterly destroy the names of the local deities. Immediately afterwards, we are commanded not to do the same to our God. From this, the rabbis inferred that we are commanded not to destroy any holy thing, and not to erase or deface a Name of God.
The Mishnah confirms that there was no prohibition against pronouncing The Name in ancient times. In fact, the Mishnah recommends using God's Name as a routine greeting to a fellow Jew. Berakhot 9:5. However, by the time of the Talmud, it was the custom to use substitute Names for God. Some rabbis asserted that a person who pronounces YHVH according to its letters (instead of using a substitute) has no place in the World to Come, and should be put to death. Instead of pronouncing the four-letter Name, we usually substitute the Name "Adonai," or simply say "Ha-Shem" (lit. The Name).
...