Investing for retirement is an important goal, however, having an emergency fund is a priority. You should first have sufficient funds which are liquid - do not require the selling of stocks or mutual funds, set aside to cover emergencies. After you establish your Emergency Fund you can start to invest for the long-term without having to worry you will need to liquidate your investments for an emergency at a time when the value is depressed - as we are seeking in the current market environment. The investments you select should match your time horizon = when do you expect to use the funds and risk profile.
Short-Term Financial Needs & Goals (you need the money in less than 3 years)
Retirement & othe Long-Term Financial Needs & Goals
A good wealth advisor will help you plan how much to save, how much to invest and what types of investments are appropriate given your time horizon and risk tolerance.