A well-studied cognitive bias is the <Framing Effect>.
If the usual price of something is presented as $10 and it's on sale for $9, people will feel good. If the usual price of the same thing is perceived as $8 and it goes up to $9, people will feel bad. This is behind the common marketing practice of setting a high list price for something, so that the actual price can be framed as a discount.
If you are healthy face the prospect of months of debilitating treatments and hospital visits, that is pretty terrible. If you have been diagnosed with a potentially fatal cancer, finding that you will endure those months of treatments and then be cured will sound very good. The first frame is, "my life with its usual ups and downs", the second frame is "am I going to live or die?".
Now let's consider a psychotherapist hearing a man's complaint. He doesn't have much interest in opposite-sex partners, his dates do not go well, and he's never had satisfying sex. He despairs of ever knowing love or of being partnered or becoming a father. What's more, he has a terrible secret he can't tell anyone. The therapist will agree that most people who see their lives that way would be very unhappy. On an imaginary scale of outcomes the question is whether he would stay at -2 happiness or with therapy progress to +2 happiness.
It looks highly likely to the therapist that the man is gay but doesn't want to accept it. A plan of therapy comes to mind. Get the patient to feel comfortable sharing his secret with the therapist, help him get comfortable with his identity, and help him live as a proud gay man. His prognosis is excellent. If he can't progress that far, the therapist will continue to feel bad for him.
But let's suppose that the therapist is in for a surprise when she coaxes the terrible secret out of him. It's actually 10-year old boys that attract this man, and he has no interest in other adult men. The therapist will be shocked. Hopefully she will not just terminate the man without a referral, but will struggle through her own preconceptions to try to help him.
Her immediate concern is (rightly) whether he is a danger to children. The problem has been reframed to include something much more serious. Hopefully her probing reveals that he hasn't abused any boys, does not think he ever will, and does not have ongoing contact with any boys that age.
We initially set the client's private happiness range at -2 to +2. Of course the happiness of other people comes into "net world happiness". Let's say his abusing children would add a -100 (whereas if he won't it remains zero). The -100 has been averted, but what has happened to the frame? If we're in a framework that accommodates a -100, a pedophile's private happiness going up or down a point will likely seem insignificant.
That's true unless you're the pedophile himself. To you, it still matters a lot whether you're at -2 or at zero. No, you can't make it to +2 because you have to leave the 10-year-old boys alone. You might possibly make it to zero if you accept your attractions and feel at peace with them.
Some pedophiles in sharing their experience with therapy will say that as soon as they revealed their pedophilia, the therapist viewed them as nothing but a molester, potential or actual. We can condemn that attitude on the grounds of plain prejudice, but the framing perspective allows us to make sense of it without assuming prejudice. From that perspective it is just the natural cognitive biases that we are all subject to, and we can combat it by pointing it out.
This framing effect is not specific to therapists. Others too who discover a man's pedophilia should be willing to look at how life looks to the pedophile himself, to reframe a second time from the -100/0 back to the -2/+2 framework.