Bebe Rexha penned the song with Justin Tranter the same day she'd found out a guy she liked had been playing her. She walked into the studio feeling heartbroken and also unstable as this was the first time she'd written with Tranter and was well aware of how much incredible work he'd done. Rexha recalled to Billboard
: "I didn't feel like I was in the mood or in the state of mind to write a record. The one thing that's so incredible about him is that I think he's able to take that out of an artist. I walked in there and I was like, I just literally started crying and I was like, 'I'm sorry, I'm a mess today. Like I'm really a mess.'"
"And he was like 'Come sit next to me.' You know what I mean? He sat me down next to him and we just started talking, and little did I know that everything that I was saying he was processing in his head," Rexha continued. "I was like, 'I just feel like a loser sometimes, and I was obsessed with this guy. And I'm also like upset with myself 'cause like why did I let this happen? Like I don't trust myself, I need to learn to love myself more, but I always think of the negative. And now I can't trust anybody around me.' And then he's like, 'OK, we're gonna write a song about this.' And then we just wrote it."