Julia Michaels, Justin Tranter and BloodPop originally wrote this back in 2016. BloodPop recalled to Billboard
"The demo of it was kind of like a chill, laid back vibe, and we were trying to write it for another artist. I can't remember who it was.
For a while, we were just going to put it out as Julia [Michaels], and then I was playing it for a good friend of mine, Josh Gudwin. He was the vocal engineer and one of the executive producers on Purpose
. That's how Bieber heard it, and then Bieber kind of finished it and - much like the other songs on the last album where it came together very fast - it was like a whirlwind, and all of a sudden it worked out."