Most sound investing advice specifically says not to invest until you have enough liquid savings to withstand an emergency - keeping in mind that the biggest emergency one might face is usually losing your job. If you don't have that saved up - or worse, are already unemployed - securities are actually a really poor investment due to their volatility. A professional skill doesn't "go down" in the same way that a stock can go down.
If you are financially secure for the time being, then buying stocks is a good idea, as you can stick that in a tax-advantaged account for retirement. Large index funds are good for this specific purpose because you don't have the risk of an individual stock getting wiped out. You can hold onto it for a long time and get your few-percent-per-year ROI.