Unfortunately, sometimes failure is inevitable. You put massive amounts of hard work into a project or new business and do everything you can to help it succeed, but it just won’t be the right time. While failure can be crushing, especially to an entrepreneur who put so much effort into their venture, you can learn a lot from it. Every failure holds valuable lessons that can help you do that much better the next time. While you may not feel like planning for the future after a failure, it’s important to look ahead. Here is some advice for the next steps you need to take to really achieve your goals.

Take time to mourn

First, you should take time to mourn the loss of your business. It’s a difficult occurrence and you’re going to feel down about losing something you put so much time and money into. Give yourself no more than a week to feel bad about it and spend time coping with it. You won’t immediately feel better after this period of time, but you’ll need to start doing something productive again. Instead of pushing forward right away, let yourself feel down for a few days.

Evaluate what went wrong

After you’ve stepped away from the situation and worked through how you feel personally, it’s time to critically examine what went wrong. Think back over the business and the decisions you, or other people, made. What ultimately caused the business to fail? Lack of funds? No new customers? Pinpoint the reason to the best of your ability so you can know where you need to improve in the future.

See what you can salvage

It’s worth seeing what you can salvage from your business. Are there tangible items like equipment and resources you can save? Do you need to sell items to cover any debt? Then, think about the business model and organization of the company. See if anyone you worked with would be interested in working on a new company. If there was something or someone that really worked well, you can use it or them again in your next business venture.

Try something new

Before launching another business, take time to do something different. It might be starting a new job in a different industry or picking up a new hobby. You could take classes or travel somewhere. Doing something different helps stir creativity and lets you think about what goals you have for your future.

Start planning ahead

Finally, it’s time to start planning once again. If you want to start another company, begin creating a business plan for what you’d like it to be and how you can build on top of what you’ve done before. Maybe you’ve decided being an entrepreneur isn’t actually for you right now, so make a plan of where you want your career to go. Set new, long-term goals for yourself and begin working on those.