If you think you might need access to a hefty sum of money in the near future, it probably shouldn’t be invested in stocks at all. But things happen in life that could create a need for raising cash from a source that was otherwise intended to be invested for the long term.
Building an emergency fund is an important first step in any financial plan, but sometimes that gets depleted and you need to access money quickly. If circumstances force your hand, you may have to consider selling a stock to meet an immediate need.