Hi, there is a gemara in shabbos 33a “כל המנבל פיו אפילו חותמין עליו גזר דין של שבעים שנה לטובה הופכין עליו לרעה
does this gemara refer to if someone speaks about sexual topics or is it even referring to if someone is upset and randomly says even one dirty word out of anger? the gemara seems to give an example of someone specifically discusses the topic.
It is clear from a number of sources that the concept of “nivul peh” Gemara refers in particular to sexual matters. For instances, the classic example of “nivul peh” is somebody who states: “All know for which matter a bride enters the Chuppah.”
“Dirty words” often have sexual connotations, but it is true that they are not being used in their sexual context. Thus, though one should be very careful not to use dirty words, which defile the mouth and are inappropriate for the refinement of Torah Judaism, the full stringency of “nivul peh” might not apply when a word is uttered out of anger alone (without the sexual context).
However, in a more general sense the concept of “nivul peh” is the opposite of “lashon nekiyah,” the “clean tongue” that the Sages extoll (see Pesachim 2a). The Rambam (in Moreh Nevuchim) explains the concept of “nivul peh” by contradistinction with a clean tongue, noting that there are no specific words for sexual organs in the Holy Tongue.
Somebody who uses “dirty words” is clearly distancing himself from the virtue of a “clean tongue,” and this is something he must be careful to work on.