Journaling and writing down intrusive thoughts can help you better understand them and their trigger, and take control. By learning what triggers you, when the triggers occur, what causes them, and how you react to them, you can learn how to take control and, with time, overcome OCD.
Journaling is a great tool for figuring these things out. Journaling slows down your mind and allows you to really inspect each thought you are going through and writing down. This allows you to understand them at a much deeper level. This deep level of learning can help you expose triggers, and can show you a clearer way of how to deal with these triggers.