The idea that homosexual individuals can be forced or persuaded to change their sexual orientation by various 'treatments' commonly grouped as Conversion Therapies is older than you may think. Historically things like religion, social ostracising and criminal punishments were used in many societies that outlawed same-sex relationships. In the modern era, psychoanalysts from Freud onwards were conflicted about whether it was actually possible, and in Freud's opinion, necessary. Some horrific techniques were tried and tested: Eugen Steinach, a Viennese endocrinologist transplanted testicles from straight men into gay men in attempts to change their sexual orientation and in the post-war period, U.S. neurologist Walter Freeman popularized the ice-pick lobotomy, lobotomizing over a 1,000 gay men, leaving many of these individuals severely disabled for the rest of their lives. In the UK, men convicted on homosexual acts faced prison and latterly drug treatment to 'cure' them, or at least suppress their sexual behaviour - Alan Turing was prescribed stilboestrol, designed to reduce libido, as a condition of his probation.
The 1952 first edition of the American Psychiatric Association's Diagnostic and Statistical Manual of Mental Disorders (DSM-I) classified homosexuality as a mental disorder (this was eventually removed in 1973). In 1962, Irving Bieber et al. published Homosexuality: A Psychoanalytic Study of Male Homosexuals, in which they concluded that "although this change may be more easily accomplished by some than by others, in our judgment a heterosexual shift is a possibility for all homosexuals who are strongly motivated to change". In the UK, male homosexuality was eventually decriminalised (for adults over 21) in 1967 but in Scotland not until 1980. Today the idea that someone's sexual orientation can be changed or 'cured' is no longer held by the medical and psychoanalytical professions. The British Association for Counselling and Psychotherapy say: "There is no scientific, rational or ethical reason to treat people who identify within a range of human sexualities any differently from those who identify solely as heterosexual." and The Royal College of Psychiatrists states "There is no sound scientific evidence that sexual orientation can be changed. Furthermore, so-called treatments of homosexuality create a setting in which prejudice and discrimination flourish."
Despite this, Conversion Therapies are still a thing; though nowadays they are restricted to fringe pseudoscience, usually driven by religious groups. They will offer what they euphemistically call 'Reparative Therapy' or 'Reintegrative Therapy', usually under the umbrella of marriage or family counseling. Some US pressure groups exist such as The Alliance for Therapeutic Choice and Scientific Integrity, who use the idea of patient choice and the "right of individuals to obtain the services of a therapist who honors their values" and they offer assistance for "unwanted homosexual attractions". In 2017, the Liverpool Echo reported on a church that suggested an undercover reporter starved himself and not drink water for 24 hours before taking part in a weekly prayer session to “cure” him of his homosexuality. The Church of England announced it considers conversion therapy "fundamentally wrong" and demanded the Government ban it and in 2018, the UK Government announced it would work towards a total ban.