Retirement is a function of four variables
Expenses
Investments
Time to retire
Returns from investment
Expenses
This is obvious but always keep in mind that these can change over time.
When you retire early/young, you will have more time to travel so that might increase your expenses.
You kids might want to study and do research so your education expenses might increase.
Old age/medical care might get expensive.
So perform due diligence to calculate expenses accordingly or just a put a large enough number for approximation.
Investments
Your expenses in the future as well as current expenses also matters. Because that will decide how much money you will put in for investments/wealth building.
Time to Retire
The more time you give for investments to compound, the more it increases. Time works in/against your favour based on when you want to retire. So start investing early no matter when you are planning to retire.
Returns from Investments
I always keep a modest expectation of 11% returns (total portfolio) so that I can adjust the other sliders. If you keep a higher expectation then you can significantly undershoot if returns are paltry. Always keep in mind that there is no guarantee to anything in life. So it is better to be over-prepared rather than under-prepared.
The Fifth Component - Investment Instrument
I did not include this because by now it is common knowledge that equity should be the vehicle that is used to build wealth.
Gold is for Jewellery.
Real estate is for consumption.
Equity is for building wealth.
Note : There are other caveats as well. But this is broadly applicable to 99.99% of the population.