Pirkei Avos 4, 5 | פרקי אבות ד, ה
,רבי יוחנן בן ברוקא אומר כל המחלל שם שמים בסתר נפרעין ממנו בגלוי
אחד שוגג ואחד מזיד בחילול השם (אבות ד:ה)
Rebbe Yochanan ben Broka says "One who desecrates the Name of Heaven in private, punishment will be extracted from him in public, unintentional or intentional, both are alike regarding desecration of His Name."
It seems that when it comes to chillul Hashem the punishment doesn't fit the crime. Firstly, even if the chillul Hashem was committed privately the transgressor is punished publicly. Additionally, even if the chillul Hashem was created unintentionally, the offender is punished just as if he had created a chillul Hashem intentionally. How are we to understand the justice of the Divine Court?
The Gemara (Yoma 86a) describes chillul Hashem as behavior that causes people to be lax in their Torah observance or to look down at those who learn or observe the Torah. Thus, by its very essence, a chillul Hashem can only be affected if one misbehaved in front of another person and not in complete privacy. The Maharal explains that when the Tanna states that the desecration of Hashem was in private, he merely meant that it was not well known since only a few people were privy to what had occurred. Whether the chillul Hashem was public or private, nevertheless, His Name was desecrated in the eyes of others. Moreover, whether the chillul Hashem was intentional or not, the bottom line is that that His Name was desecrated.
Chazal tell us (ibid.) that this aveirah is so severe that even teshuvah, Yom Kippur and suffering all combined, do not have the ability to completely erase the sin. Only at the time of death can this aveirah be totally cleansed. However, Rabbeinu Yonah (Sha'arei Teshuva 4:5) writes that there is a way to rectify even the sin of chillul Hashem. If one creates a kiddush Hashem by glorifying the Name of Hashem in the eyes of the populace, then he has in effect reversed the desecration by bringing glory to Hashem.
However, if one does not make an effort to create a kiddush Hashem, then Hashem Himself must create the Kiddush Hashem and restore His glory to the level that it was at previous to the desecration. This is accomplished by publicly punishing the wrongdoer. When people behold the punishment of a transgressor, it brings glory to Hashem's Name. When the Tanna asserts that an unintentional and intentional chillul Hashem are equal, he meant that although the intentional chillul Hashem begets a more severe punishment, both are punished in a public forum. Even an unintentional chillul Hashem must be rectified and the public retribution creates the necessary kiddush Hashem.
Indeed, a chillul Hashem is a terrible sin. Yet, the converse is also true. Making a kiddush Hashem is a tremendous zechus that not only has the ability to rectify a chillul Hashem; it is also a great mitzvah that cannot amply be rewarded in this world.
A practical suggestion to help implement this idea: Behave in a way (e.g. give in graciously during an argument) that would make people comment, "Ploni who learned Torah - observe how beautiful are his ways and how respectable is his conduct" (ibid. Yoma 86a).