Strictly speaking, you need to do both.
However, you must keep in mind the interest rates related to your debts and that you would be better off with just options to choose from for your investment other than trying to save with pending significant cash flow drains. The most common debts are home loan, credit card debt, car loan and home finishes loan. The interest rates on your debt are much higher than the interest you are likely to receive on your retirement savings nest egg – particularly since you are currently provided with low-interest rates on investments and savings. Therefore, making a list of all debts involved, paying off your debts as quickly as possible is a wise decision; so is prioritising your debts to firstly get rid of the most expensive ones.
It is never too late to save, so you can just start at a later stage in life but in order for compound interest option to work significantly, larger contributions would need to be made in this case. Sadly, saving later limits your achievements and you may find yourself having to adjust your lifestyle or delaying retirement for your future income to come to match your present financial situation.