An entrepreneur won $40,000 to build his startup, but abandoned the idea after a matter of weeks — 6 years later, the company he built instead sold for $60 million

Student Loan Hero, a personal finance site, was acquired for $60 million this week.

That milestone never would have happened if CEO Andy Josuweit stuck with his original idea for a company.

Josuweit says learning from failure is key to finding success as an entrepreneur.

Part of being a successful entrepreneur is knowing when to give up on a bad idea.

Andy Josuweit learned that on the fly when he founded Student Loan Hero, a personal finance site dedicated to helping people manage their student loan debt.

This week, Student Loan Hero was acquired by LendingTree for $60 million. But that milestone never would have taken place if Josuweit stuck to his original idea for the company.

In 2012, Josuweit and his business partners won a $40,000 grant from the incubator Startup Chile for their idea for a service called Toolbox. As Josuweit told Business Insider, Toolbox was to be an online space where professionals could build profiles around the products and equipment they use for their jobs. Users would be able to compare the products recommended by people they follow, and they would earn commission from purchases made through their profiles.

But Toolbox never came to fruition. A few weeks into the incubator program, Josuweit realized he had an even better idea, one that addressed an issue that hit close to home.

"We were playing with that idea and we saw some fundamental issues with it. We wrote down all our problems on a piece of paper in a spreadsheet and talked to advisers," Josuweit told Business Insider.

"At that point, my student loans were growing from $74,000 to a little over $100,000," he said. "I thought, 'Hey, this is my cancer, I'm bleeding right now. I need to solve this problem. And there are a lot of people like me out there.'"

Josuweit and his partners put Toolbox on hold and came up with an idea that eventually would become Student Loan Hero. The service provides financial comparison tools for student-loan holders and gives users personalized advice on paying off their debt.

Launching Student Loan Hero wasn't quite so simple — it took a week for Josuweit and his partners to convince their Startup Chile advisers to allow him to go forward with the new idea, he said.

But once it was approved, the new project quickly became personal for Josuweit. He said that as his student loans mounted, he began to feel pressure from his family to succeed. His parents had cosigned on some of his loans, and his failure to pay off the loans was starting to affect their credit.

"It created a lot of stress and pressure in my family," he told Business Insider. "There was almost a year where I didn't talk to my dad, and it was pretty traumatic."

He continued: "That's what created pressure, like, 'Hey, we have to make this work. We don't have a choice.' When you have a gun to your head, your have to push and you have to fight."

LendingTree's acquisition of Student Loan Hero not only validates the early financial struggles for Josuweit, it reaffirms his decision in 2012 to completely change courses after finding a new idea.

"You're going to fall on your face a few times, you're going to screw up and fail. You're going to learn from the failures. It takes time," he said. "But if you are willing, have the determination, have the grit, ultimately it's inevitable you will succeed."