In truth, one who possesses an understanding heart, must run away from the group of people who are “corner dwellers”, as they would run from a fire. For why should someone initially join a group of people, [concerning whom] he would subsequently be obligated to rebuke for their forbidden speech? For if he will listen to their [forbidden] words and he will become weary [due to their constant forbidden speech, thereby refraining from] responding to [and discouraging] their [forbidden words], he will [then] also be punished. [The aforementioned follows] that which is written in Sha’arei Teshuvah, as follows: “A person who hears people who are speaking Lashon HaRa, or [if] he hears anyone communicating obscene speech, or if he is sitting among a group of those scorners who ridicule the Torah and the mitzvos, and he is aware that they are recalcitrant and stiff [to respond positively to words of rebuke], and if he were to rebuke them, they will not pay attention to his words, [he is nevertheless held accountable if he refrains from rebuking them]. For, if he will place his hand over his mouth, [thus refraining from rebuking these individuals, he] will also be punished, for he did not respond to fools with regard to their foolishness. Perhaps, [due to his not rebuking those who are sinning], people will say to him that he is [just] like [the other people in the group who speak that which is forbidden], and, [since he didn’t respond to them, it may appear] that he also agrees with their [expression of forbidden] words. Even [in the situation where he is convinced that the group he is among will not respond positively to his rebuke, he is nevertheless] obligated to respond to them and to rebuke them, [in order] to attribute greatness to Torah and to mitzvos, which [these people] scorned and mocked among themselves, and he should be zealous for the honor of the innocent and righteous [individual against whom] they are speaking. [The aforementioned] is one of the reasons for which a person is obligated to leave the group of evildoers, since he will be punished when he hears their evil words and will grow weary to respond to them. This matter is explicit in the words of Shlomo, as it says, [“Do not be jealous of evil people and do not desire to be with them, for their heart thinks of plunder and their lips speak sin.” (Mishlei: 24; 1 – 2) [This verse] intends to [teach us] that you will bear a sin as a result of their sins, for you will constantly hear their evil words and you will [act] as one who is silent.]”
 The gemara states: “We similarly learn in a Baraisa: The Nikiei HaDa’as (pure minded) of Yirushalayim would act in such [a manner]. They would not sign a [legal] document unless they knew who was signing with them and they would not sit in judgment unless they knew who was sitting [in judgment] with them, and they would not enter to [partake of] a meal unless they knew who was dining with them.”
 “Corner dwellers” refer to those individuals who idly waste their time on stupidity, much as a person who hangs out at a corner, doing nothing of importance. Rav Chaim Kanievsky explains “yoshvei k’ranos” – “corner dwellers” – to refer to those who are idle and waste their time while in the Beis Midrash (Torah Study Hall).
Thus, by hanging out, idly wasting one’s time, not only is one passively wasting crucial time that can be spent on learning Torah and performing g’milus chassadim – acts of kindness, and other mitzvos, but will likely end up involving himself in idle chatter, as well as other types of forbidden speech.
In maseches Kisuvos (5b), we learn that a person should not hear improper speech and should put his finger in his ear, if necessary, to block hearing such forbidden speech. The gemara continues by quoting a Baraisa which states that a person should not listen to idle chatter, for the ears are the first of the limbs to be burnt by the fires of gehinnom, as a punishment for listening attentively to forbidden speech. In this specific case, the gemara is referring to idle chatter.
Every time we conclude a masechtah of gemara or a seder (order) of mishnayos, we recite a special prayer, which includes the following:
“We give thanks before You, HaShem, our G-d, and The G-d of our forefathers, that you have placed our portion among those who dwell in the Beis Midrash and [have] not [placed our portion] among the “corner dwellers”. For we arise early and they arise early – We arise early to the words of Torah, and they arise early for [involvement in] idle chatter. We toil and they toil – We toil and we receive reward, and they toil and do not receive reward. We run and they run – We run to the life of The World to Come, and they run to a pit of destruction, as it says, “And You, G-d, take them down to the pit of destruction, men of blood and deceit will not live half their days, and I take shelter in You.”” (Tehillim: 56; 24) (Also quoted in Pirkei Avos: Chapter 5, Mishna 19)
From the above prayer, we can see how potentially disastrous it could be for one to socialize with “corner dwellers”.
 This teaching is found in Sha’arei Teshuvah, ma’amar 197 – 198.
 This teaching that one must rebuke sinners is in line with the pasuk in sefer “Yechezkhel”, which states, “When I, [HaShem], say to the evildoer, ‘you shall surely die’, and you did not warn him, and you did not speak [in order] to warn the evildoer to leave his path of evil in order to allow him to live, he is [nevertheless] an evildoer and he shall die due to his sin, and I, [HaShem], shall seek his blood from your hand.”
The MaLBI"M on this pasuk informs us that even if you are confident that the person will not listen to you, nevertheless, you should warn him to refrain from his involvement in the sin, in order to allow him to continue to live, you would be held accountable.
Similarly, at the time of the destruction of the first Beis HaMikdash, the angels of destruction began by killing the righteous individuals, though initially they were to be spared from being killed. RaSh"I, quoting from maseches “Shabbos” (55a), notes that the Attribute of Justice was successful in getting the righteous individuals to be killed as well. The gemara notes, quoting Rav Acha in the name of Rabbi Chaninah, that the righteous were killed since, though the evildoers would not have performed teshuvah if they had warned them, the righteous did not know for certain that the evildoers would not listen to them. Therefore, the righteous were killed as well, along with all of the other people. (Yechezkhel: 9; 6)
From the above, we can see of the importance of warning individuals against committing a sin (the exception being if the person will come to hit you as a result of your warning). In light of this, one should avoid the gatherings of people who involve themselves in forbidden speech, for, among other things, that person may grow weary from protesting the forbidden speech of the people in the group and thereby be held accountable for the sins committed there.