Charlie Puth first wrote the song in 2015 with Breyan Issac and Ester Dean. He recalled to Billboard
: "It was kind of this dark point in my life. It wasn't the best month for me, without getting into detail. And of course, I had someone in mind when I wrote it."
"You never know where these songs are gonna go," Puth added. "I had originally written verses, like sing-y verses, and it just didn't feel right. It felt like it needed an Eminem type story. When I heard G's verses on it, they just happened to be something similar to what I went through. There is no other person who could have done it better than G."