Marnie, the 24-year-old heroine – and I use the word advisedly – of new drama (or comedy-drama, possibly, but one that really wrenches its laughs out of darkness) Pure, has a very specific form of OCD. Called Pure O, it manifests not as external physical acts such as compulsive handwashing or repeatedly checking things, but as powerfully intrusive thoughts, often about subjects considered taboo; such as violent, even murderous, acts or – as happens in Marnie’s mind, brutally colonised by the condition 10 years ago – sex.

We meet Marnie (played by newcomer Charly Clive) shivering by a roadside after fleeing her parents’ wedding anniversary party. During her supposedly celebratory speech, which begins as an ordinarily exquisite agony for us all to watch, her treacherous thoughts strip the assembled guests of their best suits and twinsets, and put them to orgiastic work. She falls apart on stage. Although such thoughts have been invading her inner space for a decade, this is the first time they have included her family. The mummilingus scene a little later on is sudden and shocking enough to give you a vivid insight into the distress it causes Marnie.

The six-part Channel 4 series (broadcast weekly, but available in full on All 4 now) follows Marnie as she seeks to diagnose and cope with her condition. The opening episode brings her to London, not to seek her fortune but to seek “some fucking answers”. A round of appointments with doctors yields nothing (except the unbidden vision of the psychiatrist licking her own armpit). A drunken attempt at lesbianism – in case the thoughts are the result of a repressed sexual orientation – fails, but does bring her into the orbit of the first of the gang of friends she will gather as the series goes on. In particular (from episode two onwards), there’s a recovering sex addict, Charlie, whose own problems make him the perfect foil and solace for hers. And after life in a small town – oppressive enough for many, even without the constant self-monitoring that comes from trying to hide a mental health problem – the anonymity of London is another friend. “What if I wanked on that bollard?” Marnie wonders, freely for the first time, before yelling: “There’s something wrong with me!” to the glorious indifference of passersby.

The character of Marnie is based on Rose Cartwright, who has Pure O, and Pure is an adaptation by Kirstie Swain (who herself has a panic disorder) of Cartwright’s book about living with the condition. It is bravely and expertly done. Clive’s performance is masterly; she captures the absolute normality of Marnie without ever losing the sense of equally absolute desperation as she wrestles with her mental monster. Pure was two and a half years in the making and, as well as the source material, it has had input from psychologists, charities and other individuals living with OCD. It wears that research lightly. The drama and the gags are never sacrificed to worthy exposition, virtue-signalling or finger-wagging, but, at the same time, the series has so evidently been made in such good faith that you can surrender to it entirely, never fearing that it will put a foot wrong.

Pure deals in extremes (“I can lose a day thinking about milking my mum, fingering a horse or getting teabagged by my dentist,” says Marnie, trying to summarise her inner life for Charlie), but it is for anyone who at one time or another hasn’t felt in control of their brain, and has experienced the awful fear, demoralisation, despair and loneliness that comes with it. And, thanks to the increasingly honest conversations society has been having about mental health, we now know that this is a lot of us; probably even more than we think.

And, of course, as part of this growing openness, it’s for everyone else, too. It can only add valuably to our knowledge, and increase our capacity for nuance when seeking to understand the myriad ways our minds can malfunction and trap us in a hell of our misfiring neurons’ own making. That it can do this while making us laugh with Marnie, and never at her, is barely short of a miracle, but that is what it is. Pure brilliant.