In order to exit long-term investments correctly, you need to plan the time and price of exit correctly, that is, you need to decide how long you are willing to wait to sell at a certain price X and if this does not happen, you should plan another outcome in which you will need this money or you will see that the bar you set for yourself is unattainable, you will need to reconsider it and sell this asset much cheaper than the expected price, but it is worth considering that there are always waves of peaks and declines in the market and if the market is currently peaking, then you should not invest now, for example, 3-4 years ahead, it is better to wait a year and only then start investing, with exiting the market everything is the same, only the other way around and you need to plan the exit for exactly the time when the market is expected to peak, this time it is the end of the year, the beginning of the next.