Startup founders have a million things to worry about every day.

Finding product-market fit, great talent and and a sustainable plan for constant growth are top of mind, but perhaps most importantly, they need to keep the lights on, whether it’s by raising venture capital or managing cash flows while bootstrapping.

The flip side to thinking about fundraising and growth, however, is skipping ahead to the final chapter — whether that involves M&A, an IPO or perhaps a bankruptcy, eventually all startups come to an end.

Instead of thinking about an exit while in the final throes, founders need to strategically lay the groundwork, even if it is potentially years away. Here’s how.

On the Extra Crunch stage at TechCrunch Disrupt SF, we had a deep conversation on what founders should do to prepare for an exit with Jess Lee of Sequoia, who sold her startup Polyvore to TechCrunch parent company Yahoo; Justin Kan, who sold Twitch to Amazon and now runs legal startup Atrium; and Mike Marquez, the founding managing director of boutique investment bank Code Advisors.

The good news is that the primary requirement for exiting a startup is really the same work that a founder has to focus on: building a great business. “The best way to sell your company is to actually build a good company,” said Kan, since no acquirer is looking to buy damaged goods.

But even if you are building a solid business, that’s not nearly enough to get a transaction done some time down the line. One consistent piece of advice from the group was that founders should be thinking about an exit much more regularly, even if they are steadfastly opposed to one. That means identifying key relationships that will make an M&A possible and working to build and maintain those relationships.

“I thought about it too late,” Lee said about her time running Polyvore . “The same way you build relationships with investors, you should spend at least a little bit of time building relationships with partners who could become potential acquirers.”

Kan elaborated further. “I think that in the beginning, your responsibilities as a founder is just to find product-market fit [and] work on your product,” he said. “And then once you have a product that people want, you want to figure out how to get it in the hands of more people, and that’s when it starts to become really valuable to know everyone in your market and then adjacent markets.”

Far from being a completely separate task from the other duties of being a CEO, connecting with potential acquirers often has benefits for growing a company in the first place.