If you’re an entrepreneur, you know it’s not easy to run a business. You need ambition, a clear vision and hard work to be successful.

It’s not surprising that so many entrepreneurs—after devoting all that time and energy—don’t want to think about the day when they will have to hand it over to someone else.

But that lack of foresight can have dire consequences for your company, your family and your chances of enjoying a comfortable retirement.

Passing on your business is one of the biggest challenges an entrepreneur faces. That’s why it’s so important to begin planning early.

You will need to assemble a team of advisors that will likely include an accountant, a lawyer, a banker and your financial advisor. You might also want to hire a consultant who specializes in business transitions.

Once your team is in place, there will be many important decisions to make as you build your succession plan. To start, you have to consider what to do with the business when the time comes for you to step aside.

Will you pass it on to your children? Will you sell it to your employees? Or will you try to find an outside buyer?

Is there a successor in your family?

A lot will depend on the business and your family. Is there a suitable successor among your children? Can the company be sold? Are there other shareholders? What do they want to do?

When you think about your interests, a key consideration should be to make sure you have enough money to fund your retirement.

If you are thinking about transferring the business to the next generation of your family, you have to ask: Does this business generate enough income to both create a comfortable retirement for me and my spouse and continue as a going concern?

Assuming there is enough money for you to retire and pass along a healthy business to your children, there will be another set of questions about how the succession will work.

Who will be your successor at the head of the company? How should that person be groomed to take over? How should the transaction be structured to be fair to everyone involved and minimize taxes?

If passing your business on to your children, or another family member, is not an option, then you will have to consider selling it.

Can you employees buy the business?

At that point, an important consideration will be whether the buyer will be a group of employees or someone from outside the firm. There are advantages and disadvantages to both options.

Your employees know the business and this will usually make the transition easier. Indeed, a study by the Business Development Bank of Canada found transitions involving insiders—family members or employees—perform better than outsider acquisitions.

However, employees will tend to have less money to put into the purchase. Typically, this means you will receive less cash up front and have to put more vendor financing into the deal. Vendor financing involves you agreeing to be paid a certain percentage of the sale price over time with interest.

Here is where you want to keep your personal financial situation in mind. How much cash do you need from the sale to fund your retirement? If the vendor financing can’t be repaid, will you be in trouble?

A sale to outside parties may be more disruptive to the company, but it may also lead to a higher price and more upfront cash, especially if there are multiple bidders.

Strong performance brings a higher price

The best way to get a high price for your business is to be able to show good performance and strong profits over several years. You will also want to show potential buyers that the company can run without you.

That’s why you can’t take your foot off the gas pedal when you see retirement on the horizon. You need to keep investing in technology, equipment and marketing. You also need to make sure you have strong employees and systems in place that allow the business to run efficiently when you’re not around.

It follows that preparing for the transition is not something you can do at the last minute. Just like a house that’s had some plaster and a coat of paint slapped on, potential buyers will soon see the true condition of the property.

Above all, you will need to be patient regardless of what path you plan to take. I know from my own business experience that transitions don’t always work the first time. In fact, it might take two, three or more tries.

Get started early and be patient

If you try to do it in a hurry, chances are you will not get full value for your company.

That’s why it’s important to not wait to get started, stay cool and be patient. Have that discussion with your family, business partners and key employees. And then, assemble your team of advisors and lay out your plan. It’s not easy, but the earlier you start, the better.

If all goes well, you will enjoy the fruits of your business career and ensure your legacy is preserved long into the future.