This my friend is the million dollar question…literally! If I knew the answer I would be fishing off of my yacht right now somewhere on a private island.
But seriously, in a downtrend price tends to follow a subtle pattern. This pattern can be at different timeframes and can resemble a channel, but you look for consistent lower highs and lower lows. Each lower high (swing high) should closely match up with a previous lower low (swing low) if you look to the left. This is also referred to as support and resistance levels. Some people will use Fibonacci levels to help determine these points as well.
A break in this pattern, or structure, such as the swing low stopping short and price starts to create higher highs, then you might consider exiting the trade.
There are a lot of different signals people use depending on their strategy. A breach of a certain pattern, SR zone, or a single candle. But no signal is guaranteed, and this is where your SL comes into play. Or you could manually exit the trade then re enter if price resumes the downtrend.
But once you feel the trend has come to an end, get out and move on.