if/when do I go from C&S funds (TSP) to something less risky?

M(25)
I’m currently investing about 35% of my gross income to tsp (govt 401k), and fidelity Roth IRA.
C fund 80%
S fund 20%
FXAIX IRA

I want to do my best to retire early 50-ish if not before.

My question is, when I do retire, do I leave my money on the current risky funds and just roll with it?

Do I move all the shares/money into more safe funds (idk what that would be) and how early before retirement should I make that move (or on the day of retirement should I make that switch)?

I’m trying to be as risky as I can be right now with these funds I’ve picked(without getting into real estate and other forms of investment since I’m more a set it and forget it saver), but I’ve seen the market tank and that would suck in retirement when I don’t have years of time to see it bounce back.