The famous Mitzvos of Kiddush HaShem and Chillul HaShem feature in Parshas Emor: The Torah instructs us: “And you will guard My Mitzvos and do them, I am HaShem. And you will not desecrate My holy Name, and I will be sanctified amongst the children of Israel, I am HaShem who sanctifies you.: The terms, Kiddush HaShem and Chillul HaShem are liberally used, sometimes when one disagrees with the action of his fellow, yet in truth, the Rambam gives three applications of this Mitzva.
The first is that a person must be willing to give up his life rather than transgress one of the Three Cardinal Mitzvos if a non-Jew forces him to transgress with the threat of killing him. Likewise, one must to transgress any Mitzva when he is forced to transgress it in order to undermine the Torah; and the same applies in a shaas shmad (time of decrees against the Jews). If one gives up his life in any of these situations, then he fulfils the Mitzva of Kiddush HaShem. Conversely. If a person fails in this nisayon and commits the sin when he should have let the non-Jew kill him, then he transgresses Chillul HaShem.
The second, less well-known aspect of Kiddush HaShem is when a person resists his temptation to sin, or performs a positive Mitzva purely for the sake of HaShem. Conversely, if a person sins not out of temptation, but in order to anger HaShem, then he transgresses Chillul HaShem. It is important to note that these cases apply even when nobody else is present.
The final application of Chillul HaShem is when a person acts in a way that may not technically be forbidden but they are not fitting for the person at his level and onlookers see that a person representing Torah is acting in an inappropriate manner. The Rambam, based on Chazal,gives examples of a Talmid Chacham not paying of his debts immediately, being too light-headed, not greeting people with a sever panim yafeh (smiling face), and getting into arguments. Conversely, when such a person speaks nicely, smiles towards people, does not reply to insults, does business with integrity, acts beyond the letter of the law, he does a Kiddush HaShem.
One area that the Rambam does not enumerate as an example of Chillul HaShem is when a person proudly observes Mitzvos even when onlookers will be angered because he is keeping the Torah, or mock his actions. The following story demonstrates this idea brought by Rav Yeshaya Horowitz.
When Rav Ben-Tzion Fellman was a child, he lived in Tel Aviv and proudly wore his tzitzis out even though he was surrounded by many non-observant people. Sometimes people stopped him in the street to ask about them but it didn’t discourage him from wearing them. However, Ben-Tzion faced a difficult upcoming challenge – in the words of Rav Horowitz: “Summer vacation approached. The Fellmans arranged to go to Beis Bosel, a government-run guest house in Tzfas. When Ben-Tzion asked his friends about it, though, they told him that some of the people who went there didn’t keep Mitzvos. Ben-Tzion was worried about spending a week among people who didn’t know a thing about tzitzis, who might make fun of him. He considered tucking in his tzitzis, just during the vacation, and went to ask the Chazon Ish what he thought. ‘The Rema answers the shailah at the beginning of the Shulchan Aruch’, the Chazon Ish told him. He got up and took the first volume from his shelf. Opening it, he pointed to chapter one, paragraph one, and invited Ben-Tzion to read along with him: ‘Do not be embarrassed by people who scorn avodas HaShem’. With his other hand, he took Ben-Tzion’s hand. He got up and they paced back and forth in the room holding hands, singing the Rema’s words. ‘You hear’, he told Ben-Tzion. ‘Continue to wear your tzitzis in the open. Do not be embarrassed by people who tease you for your avodas HaShem.
In later years, Rav Ben-Tzion spoke about how the Chazon Ish’s words gave him the strength for the rest of his life, to engage in avodas HaShem without worring about what others thought.”
We have seen the true definition of Kiddush HaShem and Chillul HaShem. May we merit to only sanctify HaShem’s name in private and in public.
 Vayikra, 22:31-32.
 Rambam, Hilchos Yesodei HaTorah, Chapter 5.
 See ibid, Halachos 1-9 for all the details of these halachos.
 Ibid, halacha 10.
 There may be situations where keeping a chumra adversely affects others, and it may be preferable to do the Mitzva in a way that is normally less ideal. One application of this is praying in a minyan on a plane, when it will disturb other people sleeping, or block the aisles, and bother other people. In such situations, many Poskim rule that it is better to pray alone in one’s seat.
 ‘A Treasury of Stories’, Rav Yeshaya Horowitz, Part 1, pp.197-198.
 Emor, 24:12.