Can you imagine losing your job and losing $185 million in Facebook company shares in the process?

That's exactly what happened to Noah Kagan, founder of AppSumo and SumoMe. We all learn lessons from failure, and Noah is a great example of somebody who was able to turn things around and become successful. His AppSumo site currently has more than 700,000 active subscribers, and SumoMe is a successful product marketing platform.

You too can learn from his mistakes--and you don't have to lose $185 million in the process. Here are five important lessons you can learn from Noah's experience:

Don't Let Your Ego Get in the Way of Your Success

At 24, Noah was very proud to be working at Facebook--too proud, actually. He hosted startup gatherings at the Facebook headquarters to show off his workplace, and wrote blog posts on his personal website about Facebook's business practices and internal workings. Things eventually reached the point where Mark Zuckerberg himself was forced to ask Noah to choose between Facebook and his own personal agenda. Noah didn't get the message, and wound up fired as a result.

In his own words, Noah said that what he learned from this experience is that, "The BEST way to get famous is make amazing stuff. That's it. Not blogging, networking, etc." Those are wise words from someone who unfortunately learned the hard way. Take this lesson to heart--don't let your ego short-circuit your success.

Don't Let Your Job Be Your Whole Identity

As Noah wrote on his blog, his job at Facebook meant everything to him. Everyone he knew, every event he attended, and every goal he had revolved around the company. He even lived in a house shared with six other Facebook employees. As a result, it's unsurprising that his firing sank him into a deep depression that lasted more than a year.

Noah later admitted that he understood that he had let the company outgrow him, while he had refused to adjust. He was the right employee for the company when he started, but he didn't fit in with where they were going. Because his job was his entire identity, he couldn't see that the company was changing and he needed to as well. Don't fall into this trap--develop a life and skill set outside of your job. You may be great for your firm today, but tomorrow it may not be the right fit. Be ready to either change or move on.

Don't Be Blind To Your Weaknesses or Vulnerability

Absolutely no one is irreplaceable. By realizing that, you can see your own vulnerability and work to cement your position with your company. Unfortunately for Noah, he realized this important lesson too late. Because he was Employee #30 at Facebook, he didn't think that he would ever need to worry about the security of his position. As a result, he wasn't able to see how his weaknesses were hindering his effectiveness.

When you can see how your weaknesses are keeping you from being your best self at work, you can make adjustments or seek mentoring to change. If that's not possible, you can move on to a position where your specific weaknesses are less important and your strengths are magnified.

Ask Yourself How You Can Improve the Company

Noah found himself so excited by the status and prestige of working at Facebook that he never thought about how he could make the company more valuable. As a result, his actions ended in him being called 'a liability' to the company, and he lost his job. As he writes on OKDork, those words scarred him and he's worked hard to become an asset to every company he's started or worked with since.

You don't have to lose your job to realize that there are ways in which you might be a liability to the company you're with. Work to correct or minimize those mistakes. Then, ask yourself how you can improve your company. If you're consistent in making a difference, your position will be much more secure.

Understand That Sometimes Being Let Go Opens Something Better

Ultimately, some employees will never be a good fit for the companies that hiring them, requiring them to move on to (hopefully) bigger and better things. Noah, as an example, capitalized on his experience with Facebook to set out as a tech entrepreneur and build his own companies. And interestingly, after having to let some people go at AppSumo, he says that instead of kicking them out the door, he draws on his past experiences being terminated and tries to work with them and point them in the direction of a better path.

You can do this for yourself as well. Realize that losing one opportunity doesn't mean you'll never be successful again. Look for new opportunities that better capitalize on your strengths, and you'll find yourself back on your feet again in no time at all.

Losing a major opportunity--and a major payday--isn't an easy thing to recover from. But when you use these difficult situations to learn important lessons and go on to create new success, that's something to be celebrated. Noah Kagan is one example of an entrepreneur who's done that for himself. Take the lessons he's drawn from his own experiences and use them to avoid the pitfalls he encountered to create better and greater success for yourself.

What's the biggest lesson you've learned from a past business mistake? Share your thoughts in the comments!