This heartfelt song was inspired by a pal of Puth's. The singer told MTV News: "My friend was talking to me about his long distance relationship and how it breaks his heart that he can't see his girlfriend every day, so I wanted to make an anthem for everyone in a long distance relationship or just someone they haven't seen in awhile is just one call away."
The song has a gospel flavor, which is not surprising as Puth grew up playing in a church. He recalled to Billboard magazine: "I have perfect pitch. I'd go to church every Sunday and hear the same songs. When the church organist didn't show up, I played the whole mass from memory, and they all praised me for it, and I realized, 'Oh, s--t, I know how to play piano, and I can probably write songs.'"
This song was written at a songwriter's camp with contributions from six writers: Puth, DJ Frank E, Shy Carter, Maureen McDonald, Breyan Isaac and Matt Prime. "Charlie is like my little brother," Isaac told Songwriter Universe. "It was one of those nights where everybody had gotten together, and we were sitting by a campfire. It was one of those legitimate campfire songs where the guitar comes out around the fire, with marshmallows roasting. Then the idea started with DJ Frank E coming up with the chords, and everybody kind of pitched in on that song. It turned out to be amazing... I'm really happy about it."