Tourette's syndrome is the condition where people involuntarily shout swear words and slurs, blurting obscenities out of nowhere. It is how Tourette's shows up in nearly every film and sitcom: the character who suddenly yells something rude and cannot help it.
The involuntary swearing, properly called coprolalia, is real but it is rare, affecting only a minority of people with Tourette's, with estimates commonly around one in ten to one in five, not the defining feature. Tourette's syndrome is actually a neurological condition defined by tics: repeated, involuntary movements and sounds, such as blinking, head jerks, throat clearing, sniffing, or repeating words. For most people who have it, the tics are nothing to do with swearing at all. Media latched onto coprolalia because shouting obscenities is dramatic and funny on screen, and so the rarest, most sensational symptom became the public face of the whole condition, which is frustrating and stigmatising for the majority who do not have it. So the swearing trope misrepresents most people living with Tourette's. The core of it is involuntary tics. The cursing is the exception that Hollywood turned into the rule.