There's the classic joke where someone goes to the doctor and says "it hurts when I do this", and the doctor says "well don't do that then".
Cognitive behavioral therapy is basically the same thing but it boils down to: "it feels bad when I think about this" / "well don't think about that then".