This is part of the behavioral treatment. This
therapeutic modality consists of identifying harmful or
self-destructive behaviors and replacing them with healthy behaviors. This under the premise that both behaviors are learned, so you can replace and learn good behaviors. In
the case of Obsessive-Compulsive Disorder, the patient is taught
behavioral guidelines to manage anxiety and control his impulses.
I hope my answer can help you.