It is luck. And some educating guessing perhaps. But, no one, save some professionals (who too are wrong quite a bit), can make money long term from timing.
I'm happy to share what I did and haven't yet finalized. On April 2, 2019, I sold all my holdings in my retirement accounts (75% SP500, 25% stocks) and bought bonds. It was worth $1.2M then; today, it's worth about $1.3M. I just sold the bonds and am going to repurchase my holdings soon.
I based my guess on (a) the high Schiller PE; (b) my concern for the long term effects from Trump's tax cuts and tariffs; (c) Trump's unabashed willingness to publicly punch the Fed and Fed Chairman; (d) Trump's foreign policy which generally involved alienating our traditional, staunch allies; and (e) my lack of confidence in Trump's leadership. That sounds very political, and perhaps it can't be divorced from the political nature of it, but my advice on page 4 of this thread was that such decisions shouldn't be political and I didn't consider mine to be that at the time.
In any event, I put sideboards on myself. When I sold, I figured I'd stay on the sidelines until a 20% dip or a 20% climb, or if neither, a change in leadership. The SP500 was valued around 2850 when I sold and my target re-entry was 2300. I was mentally ready to take the 20% lost opportunity costs going into my 1-year sale anniversary. I certainly could not have predicted, or would have wished for, a pandemic such as this one. It's pretty horrible.