If you’ve ever listened to Demi Lovato’s “I Love Me” and felt a pang of pain during the chorus — when the singer belts, “Oh, why do I compare myself to everyone? / And I always got my finger on the self destruct” — then you can’t imagine what songwriter and producer Oak Felder, Variety‘s May Hitmaker of the Month, went through in creating it.

“To be honest with you, it was a painful process for me specifically: I started working on the idea for that song the week that I found out she had overdosed,” Felder says of Lovato’s July 2018 hospitalization following six years of sobriety. It was his and Lovato’s sixth collaboration overall, including the 2017 No. 1 hit “Sorry, Not Sorry.” Adds Felder: “I didn’t realize how much my relationship with Demi affected me until she overdosed — I couldn’t work. I was not functional and I canceled all of my sessions. She reached out to me not too long after it happened and I felt this wave of relief. It was my brain’s way of telling me, ‘This person means a lot to you.’ ”

Ironically, the song that evolved into Lovato’s empowering self-love anthem — perhaps the most personal she has ever recorded — was originally written with someone else in mind. “The track started off as a song for Anne-Marie,” Felder says of the bop with a different title (and a very different message) that didn’t make the cut for the U.K. artist’s sophomore album, which is due out later this year.

“But I always loved a certain melody,” Felder says of the scrapped tune, and he couldn’t get it out of his head when he reunited with another frequent collaborator, Sean Douglas, and Lovato after she recovered and began to contemplate her comeback. “I went, ‘Oh s–t, I might have a production that works,’ ” he remembers. “I played the first version of the track and sang the melody for Demi and she was like, ‘This is fire.’ So then we sat down and rewrote the whole thing.”

Critics can’t accuse Lovato — or Universal Music Group labels Island and Republic — of playing it safe as far as lead singles go. “It was a risk putting out ‘I Love Me’ first,” says Felder. “It’s this confessional song but has all this rhythm and energy and you can dance to it — those things shouldn’t happen together. But that way, it says: ‘I f–ed up but finally I’m in a space where I love myself.’ The music serves as a soundtrack to that message so it’s upbeat and celebratory. This is meant to be like that cathartic feeling after you’ve cried. Demi felt it was important for her story to be conveyed so I gave her the vibe and let her speak her truth over it.”

Felder, who is represented by Lucas Keller at Milk & Honey, recalls the process of translating her truth into lyrics: He was sitting at the console in his Los Angeles studio with Douglas and Lovato facing him while they spit ideas back and forth. “When somebody said something dope enough, we put it down,” says Felder. “But it was conversational, too: ‘What kinds of things do you read that make you feel like you’re being attacked?’ ” (Hence the opening lyric: “Flipping through all the magazines / Telling me who I’m supposed to be.”) Fortunately, the Force was with them: Felder’s fanboy decor — wall-to-wall “Star Wars” paraphernalia, including a nearly life-size Darth Vader looming in the corner — caught the eye of Douglas, who contributed the reference to “Jedi-level [self-] sabotage.”

But Lovato’s mind is also where the magic happens. “It was quick — maybe two hours,” Felder says of their session. “You’re dealing with three people who are very analytical, so this is something that we’ve thought about for days before getting to this point. One thing I can say about Demi: She for s–t sure knows what she wants to say. … She’s one of the realest people I’ve ever met, and that is rare in the music industry.”

Felder credits her “bold, unapologetic and very dynamic” personality for the production. Lovato sings about her struggle with self-destructive tendencies as the chorus soars, then her vocals fade away along with the beat and everything goes quiet. “It’s almost like she has this inner voice that says: ‘I wonder when I love me is enough,’ ” says Felder. “Demi has this broad range: She can be aggressive or she can be the most introspective, sweet person. And I wanted to represent those two energies, creating this big moment and then this smaller one to convey the more honest idea.’ “

It may come as a surprise to some that a “400-pound, 6-foot-5-inch Black Turk with a mohawk,” which is how Felder described himself in a recent TED Talk, is so in touch with his feminine side, and capable of writing from the perspective of a young woman who has battled substance abuse, an eating disorder and toxic relationships, among other issues. “I’m not going to lie to you — I’ve been the guy taking a walk and a middle-aged white woman will cross the street [to avoid me],” says Felder. “It’s sad, man. But being a big guy forced me to want to understand how other people saw me — it gave me the gift of perspective at an early age. Sensitivity can be born of humility if you take yourself out of your own ego, and it’s a superpower. It allows me to get inside the head of someone like Demi.’ “

In fact, it’s the key to Felder’s success. “When I sit down with an artist and they tell me what kinds of f–ed up shit they’re going through, I can really identify,” he says. “We’ll write a song about it and they’ll be like, ‘This is exactly what I wanted to say.’ Being able to sing about something is therapeutic and the producer’s job is to facilitate that. It sort of makes us therapists by default.”

And in this instance, perhaps also addiction specialists. “The point that Demi turned a corner for her recovery was the moment that she said, ‘I’m going to start doing all the right things — and I’m just going to do it for me, not anyone else,’ ” says Felder. “I grew up in a country that might have 10 black Turkish people, so I identified with the concept of trying to figure out who you are and trying to achieve a sense of confidence. At the end of the day, you can only have confidence in what you decide that you are. Demi decided that she was going to love herself, and I connected with her on that level.”

And “I Love Me” is connecting with listeners, amassing more than 70,000 spins on radio, per Mediabase, with the Top 40 and Hot AC formats leading the way — good for a Top 20 showing in overall consumption. According to Alpha Media, the gold-certified song has moved more than 600,000 adjusted units to date vis-a-vis 82.3 million streams. The video has 34.5 million views on YouTube. The song precedes Lovato’s forthcoming seventh album, her first under new management with Scooter Braun’s SB Projects.