There's definitely an element of learning mindfulness that's key too. Learning to accept the uncertainty of random "terrible" thoughts that pop into your head, learning to not engage with them and letting them pass, etc.
I recommend two books: The Imp of the Mind by Dr. Lee Baer [2] and The Mindfulness Workbook for OCD by Jon Hershfield and Tom Corboy [3]
[1] https://iocdf.org/about-ocd/treatment/erp/
[2] https://www.amazon.com/Imp-Mind-Exploring-Epidemic-Obsessive...
[3] https://www.amazon.com/Mindfulness-Workbook-OCD-Overcoming-C...
Nowadays that is no guarantee of respectability! Seriously, I think the typical professional carries a substantial psychological load due to the conformity and personal constraint entailed.
>I think we'd all be better off if we talked more openly about it
Well I tend to classify unwanted thoughts as the purely mental equivalent of chewing on chilli. Why would I think unwanted thoughts? The answer is similar to why would I prefer foods that cause pain to my tongue and mouth.
After finally getting fed up/building up the nerve to talk to my doctor about what was going on in my head, she clarified what OCD was doing (intrusive thoughts -> anxiety -> mental compulsions to make the anxiety go away -> intrusive thoughts get worse, more compulsions "required" to make it go away) and gave me a diagnosis of such, as well as some treatment recommendations.
I just recently wrote about dealing with OCD and posted it to social media, announcing it publicly. There was an outpouring of support, and even more satisfying, a few private messages of people discussing their own, very private battles with mental illness.
It's a huge, private struggle for most, and I think we'd all be better off if we talked more openly about it.