Based on Mishnah Torah I: Book of Knowledge, the Laws of Foundations of Torah, Ch. 5
What does it mean to Sanctify God's Name?
What about to Desecrate God's Name?
How far do we have to go to NOT Desecrate God's Name?Our actions matter. They are either serving a mundane, self-serving agenda OR they are serving the highest of purposes which is to do what our Creator put us here to do — to do the right thing because it is the right thing.
Here are the Rambam's Opening words in this chapter:
The entire house of Israel are commanded regarding the sanctification of [God's] great name, as [Leviticus 22:32] states: "And I shall be sanctified amidst the children of Israel." Also, they are warned against desecrating [His holy name], as [the above verse] states: "And they shall not desecrate My holy name."
What is implied? Should a gentile arise and force a Jew to violate one of the Torah's commandments at the pain of death, he should violate the commandment rather than be killed, because [Leviticus 18:5] states concerning the mitzvot: "which a man will perform and live by them." [They were given so that] one may live by them and not die because of them. If a person dies rather than transgress, he is held accountable for his life.
When does the above apply? With regard to other mitzvot, with the exception of the worship of other gods, forbidden sexual relations, and murder. However, with regard to these three sins, if one is ordered: "Transgress one of them or be killed," one should sacrifice his life rather than transgress.
When does the above apply? When the gentile desires his own personal benefit - for example, he forces a person to build a house or cook food for him on the Sabbath, he rapes a woman, or the like. However, if his intention is solely to have him violate the mitzvot, [the following rules apply:] If he is alone and there are not ten other Jews present, he should transgress and not sacrifice his life. However, if he forces him [to transgress] with the intention that he violate [a mitzvah] in the presence of ten Jews, he should sacrifice his life and not transgress. [This applies] even if [the gentile] intended merely that he violate only one of the [Torah's] mitzvot.
All the above [distinctions] apply [only in times] other than times of a decree. However, in times of a decree - i.e., when a wicked king like Nebuchadnezzar or his like will arise and issue a decree against the Jews to nullify their faith or one of the mitzvot - one should sacrifice one's life rather than transgress any of the other mitzvot, whether one is compelled [to transgress] amidst ten [Jews] or one is compelled [to transgress merely] amidst gentiles.