Live below your means (LBYM) and save as much as you can.
If you can start saving 40% of your income right now, you can retire in about 22 years, at age 50, if you earn a (fairly conservative) 5% on the money over those 22 years (based on a SWR of 4%)*.
And if you can save more (i.e. > 40% as your income rises) or earn more return on your money, then you can retire sooner.
I.e. if you can save 60% now and earn 7%, you can retire in about 11 years*. Though if you're retiring that early (age 40ish), you'd probably want more of a cushion and lower WR.
In any case, numbers aside, LBYM and save as much as you can.
Also the standard advice on these forums for someone your age: enjoy this age while you can. Don't look too far forward and miss what you have now.
*Math based on Nord's post here:
How many years does it take to become financially independent? | Military Retirement & Financial Independence