LONDON — When Olly Alexander burst into tears shooting a scene of “It’s a Sin,” no one was very surprised.
Making the show, which came to HBO Max on Thursday and follows a group of friends embracing the gay culture of ’80s London under the shadow of AIDS, was emotional for many of the cast and crew — and Alexander is as comfortable showing his vulnerabilities as the character he plays, Ritchie, is at deflecting them.
“I was a complete mess after the first take,” Alexander, 30, said in a recent video interview. “I was sobbing.” Peter Hoar, “It’s a Sin’s” director, paused filming.
The scene in question, which comes after Ritchie and his friends are arrested protesting the British government’s inaction on AIDS, is one of many in the show that explore how the epidemic devastated gay men’s lives.
When we meet Ritchie, he is an impishly confident, but naïve, 18-year-old who has just moved to London, with dreams of becoming an actor. Alexander also moved to the capital from rural England at 18 and scored his first movie role, but today he is better known as the lead singer of the band Years & Years. “It’s a Sin” is his first acting gig in six years.
Years & Years’s music often explores the relationship between desire and shame, and is heavily influenced by ’80s bands like Pet Shop Boys. (“It’s A Sin” takes its title from that group’s song of the same name.) So when Alexander heard Russell T Davies, the show’s creator, was interested in him for the lead role, the opportunity “made poetic sense,” Alexander said.
In an interview, Davies said the show was “cast gay as gay, which is my policy.” For Ritchie, he added, he wanted an out actor who already had a big profile in Britain. “That almost narrows it down to a field of one,” he said. “It was the simplest audition of my life.”
Alexander’s arch performance as Ritchie suggests that the character’s ambition and bravado are reactions to fear and self-loathing. “I realized straight away, ‘Oh, I know who Ritchie is,’” Alexander said. “He’s trying to get onstage and shine and dazzle: I’ve done that.”
But whereas Ritchie masks his vulnerabilities, Alexander has spoken frankly in interviews and onstage with the band about his experiences of bulimia, anxiety, self-harm and depression.
“I’ve said just everything about myself,” he said. “My life is kind of out there now.”
Alexander grew up in Gloucestershire, in western England, where his mother founded a local music festival. His father, an aspiring musician, worked in amusement parks.
It was a creative household, Alexander said, but his father had mental health problems and substance abuse issues that led to a difficult atmosphere at home. When he was 14, his parents separated; he’d only seen his father a handful of times since, he said.
School was an even more fraught environment, and Alexander experienced homophobic bullying from age nine. “I had long blond hair, and I acted quite feminine,” he said. “That made me a target. And kids can be so cruel.”
As Alexander recalled his younger self, he started to cry. It took many years until he could look back at the child he was with compassion, he said. “But that’s the biggest thing I’ve tried to do,” he added. The impact of his childhood is something he’s still processing in weekly therapy, he said.
When Alexander’s high school classmates went to college, he moved to East London and became a jobbing actor while babysitting and waiting tables. A pale, skinny teenager with a nest of tight curls, he landed roles as the tuberculosis-ridden younger brother of Ben Whishaw’s Keats in the film “Bright Star,” and an anguished drug user in Gaspar Noé’s trippy art movie “Enter the Void.”
Alexander had been living in London for a couple of years when he met his Years & Years bandmates, Mikey Goldsworthy and Emre Türkmen. Though they started out making high-minded, Radiohead-inspired electronic music, Alexander pushed the band toward synth-pop, with big, melodramatic choruses full of longing.
In 2015, the band’s exhilarating but anguished song “King” — about the strange thrill of being treated badly in a relationship — reached No. 1 in British singles chart, and its debut album, “Communion,” topped the album charts, too.
“His songs are his life,” said the producer Mark Ralph, who has worked with Years & Years from the band’s earliest days “If you want to know what’s gone on in Olly’s life, then you just read all his lyrics.”
“Love takes its toll on me,” Alexander sings in “Sanctify,” a song about a secret liaison with a straight man. “And I won’t, and I won’t, and I won’t be ashamed.”
When the band performed the song at the Glastonbury Festival, in 2016, soon after the shooting at the Pulse nightclub in Orlando, Fla., a rainbow-clad Alexander told the crowd, “I’m here, I’m queer, and, yes, sometimes I’m afraid.” But, he added, “I am never ashamed, because I am proud of who I am.”
The speech caught the interest of TV producers, and, in 2017, he fronted a BBC documentary called “Olly Alexander: Growing Up Gay.” In it, he returns to his family home and leafs through teenage diaries full of references to bulimia and self-harm. On camera, he tells his mother about the bullying at school for the first time: Through tears, they discuss how it led him to mental health problems in his teenage years.
“It’s a lot to ask someone to bare their soul on national television,” said Vicki Cooper, the TV movie’s director. “But those difficult conversations created the best moments in the film.”
That documentary, and Alexander’s openness about his own mental health, mean he gets a lot of messages on social media from fans who are struggling themselves. He used to try and respond to them, he said, but the quantity has become impossible to keep up with.
Through those messages, though, Alexander had “seen a really emotionally vulnerable side to a lot of people,” he said. “That’s a precious thing, actually.”
Alexander had also been humbled by the positive response to “It’s A Sin” in Britain, he said. The show broke records for the streaming service All4, where it aired, with 6.5 million streams.
“It’s A Sin” first appeared on All4 during National H.I.V. Testing Week; on social media, the show’s cast encouraged viewers to get tested. The Terrence Higgins Trust, an H.I.V. nonprofit, said that the number of people taking tests through their service had almost quadrupled in the weeks afterward.
“People living with H.I.V. now can live normal, healthy lives: It’s so important to get that message out,” Alexander said, adding that treatments for the virus had transformed since the ’80s. “I’m really grateful that these conversations are happening, because, honestly, lots of people really didn’t know what was going on in this period of history. They’re shocked to learn about it now.”
That era is also having an influence on Alexander’s music. He is currently recording new material with Years & Years, inspired by the ’80s dance anthems of the “It’s A Sin” soundtrack and beyond: Donna Summer, New Order, Pet Shop Boys.
“During the pandemic, I wanted to listen to super upbeat club music that made me dance around,” he said. “I found myself wanting to create the fantasy and the energy that I haven’t necessarily been experiencing.”
As well as working on new music, Alexander said he had spent the lockdowns in England watching “Real Housewives” episodes, and playing Animal Crossing. “I used to be so, so driven,” he said, but now he was putting less pressure on himself.
He was happy, he added, to think back on what he’d already achieved, and how much has changed since he was a little boy who wished he wasn’t gay.
“I’ve kept a diary since I was 13 years old,” he said. “Sometimes I look at it and think I can tell this kid: ‘You’re going to do amazing things. You’re going to get to where you are now. It’s OK. You got this.’”
Hugo Yangüela contributed additional camera operating for photographs.