It’s not easy to make one of the best-selling singles of all time.

In fact, Bruno Mars told Lara Logan on “60 Minutes” that the process behind his smash hit “Uptown Funk,” which won a Grammy for Record of the Year in 2015, was so frustrating he almost completely gave up on it.

“‘Uptown Funk’ took us almost a year to write,” he said. “And there’s songs that taken us two hours to write. And we throw ‘em away. ‘Uptown Funk’ was in the trashcan about 10 times.”

Get Breaking News Delivered to Your Inbox

He explained to Logan why it was so difficult.

“‘Cause we made a lot of, you know, you can make a left turn and all of a sudden this song is something terrible. Embarrassing almost,” he said. “But you have this one thing that keeps you going. This one part of the song that feels so good and it makes you want to keep going. And it makes you want-- ‘Ah, we should just try again. Let’s try again, let’s try again.’”

Luckily for his fans, Mars persisted. He admitted that coming off the success of “Uptown Funk was “daunting,” but now he’s back with “24K Magic.”

Learn more on the process behind “24K Magic” on “60 Minutes” on Sunday.