"I met her in London [and] we just became fast friends," Puth, 24, tells ET during an exclusive sit-down chat in the living room of his new home in the Hollywood Hills.
"This record, 'We Don't Talk Anymore,' was not even recorded in a studio," he revealed. "The guitar line that I had in my head started in Japan. I got my guitar, I was like, 'Yo, lay this down,' I was in my hotel room, and I literally record the guitar with my iPhone, which is crazy. I didn't even have a mic set up. Went to the Philippines, produced the beat out, like the drums, and I recorded the vocal back in Los Angeles. Then, a week later, I called Selena up after I sent it to her, and she fell in love with the song."
Then came the task of recording Gomez's vocals -- and the process was unconventional, for sure!
"She came over and I literally set the mic up in a closet," Puth revealed with a laugh. "So, I can say that I've vocal produced Selena Gomez while she's in a closet recording. It was, like, the most ghetto set up ever, but I think it added to the quaintness of the record. She did a really good job, too."
While Puth took the reins as producer on the track, the 23-year-old Gomez offered up plenty of sage advice about making it in the music biz.
"She's very used to the spotlight, and I'm now kind of getting in that world, and I kind of got freaked out about it. She's a really good person that I can kind of turn to and ask for advice," Puth said.
The best words of wisdom she's offered? "'Don't show all of your cards,' she told me," Puth recalled. "When you're walking to the airport, and you know, you haven't slept, and you've done 12 hours of promo, and you've had cameras in your face all day, and the last thing you feel like dealing with is with people who are pretending to be fans just so they can get your signature and put it up on eBay -- just walk and acknowledge them, and say 'Hi,' and just walk away. I've gotten angry in the past, and it does absolutely nothing."
Puth said his whole album was inspired by the "crazy last year," which saw the meteoric rise of his breakout single with Wiz Khalifa, "See You Again." Next month, the pair will hit the GRAMMYs red carpet as their Furious 7 track vies for three trophies.
"We got tagged as, like, the world's most unlikely duo. But it's cool, I go everywhere with him every time we play the song and I'll go to the award show with him," Puth said, revealing that both artists plan to bring their moms along as their dates.
Family is everything for Puth, who shares his new home with his siblings.
"They let me know that 15 years ago we couldn't even afford tomato sauce so we had to use ketchup on spaghetti," he said, reflecting on the importance of staying grounded. "Money can go away really quickly if you over spend and don't save."
In the end, Puth hopes his album serves as an inspiration to young, aspiring musicians.
"My whole thing is, I want kids who are producing records in their basement like I was a year ago to hear this album and know that there's a light at the end of the tunnel," he said. "You too can move to L.A. on a whim, get in studios, and write a number one song. I want them to realize that when they hear the album."