I remember being told as a youth to strap a rubber band around my wrist. Whenever I had an unworthy (i.e. sexual) thought, I was supposed to snap the rubber band, causing pain. The idea was that I would begin to form a negative association with unworthy thoughts. In other words, this was a rudimentary form of aversion therapy suggested by my Mormon leaders.
This was just an idea floated out there, so I never really wore a rubber band. I had no idea how far the Mormon leadership actually took aversion therapy until recently. Many homosexual youth were subjected to aversive shock therapy in order to convert them to heterosexuality. They viewed graphic homosexual pornography in a laboratory, lab workers shocked them when they became aroused. They would then view heterosexual pornography while soothing music was played. Many of the patients had never viewed such pornography to that point in their lives.
Main Street Plaza recently highlighted a short documentary—Legacies—about men who underwent this therapy.