One is not permitted to say Hashem’s name in vain. This prohibition is derived from the posuk, “Es Hashem Elokeicho tira”, one should fear Hashem. If a person says one of the Seven Names of Hashem in vain it is considered violating this halacha and is an issur de’oraysa (a Biblical prohibition). The same halacha applies to saying the names of Hashem in any other language, for example the name of Hashem, G-d, should not be said under ordinary circumstances. In addition, according to many opinions it should not be written either, and therefore it is recommended to write it with a dash, G-d, instead of spelling it out. According to halacha, if a person has simchas halev, is genuinely happy and wishes to thank Hashem, then it is considered a tzoirech, a proper need, and one may say "Thank G-d". However, often this expression is said just because people are accustomed to speaking that way, but do not have genuine simchas halev, and therefore it is preferable to always use another expression. For example, instead of saying "Thank G-d", a person should say "Thank the One Above" or "Boruch Hashem".