Q: I have a 401(k) at work but want to get started investing outside of retirement accounts. Should I start putting money into the stock market?

Whether you're talking about investing in individual companies or simply buying mutual funds or ETFs in a brokerage account, investing in the stock market is an excellent way to create wealth.

Having said that, there are two big questions you need to answer before you put any money into the stock market.

First, do you have any high-interest debt, such as credit cards? It doesn't make good financial sense to invest some of your money if you have outstanding high-interest debts.

Here's why: The stock market has historically generated total returns in the 10% ballpark over long time periods, so this is a reasonable estimate of what your investment performance could be over time. However, let's say that you also have credit card debt at 18% interest. Mathematically speaking, paying the debt gives you a better expected return on your money.

In other words, investing while you have high-interest debt hanging over your head is setting yourself up to actually lose money over time.

Second, could you handle an unexpected expense? Simply put, it makes no sense to put money into an investment account that you're going to need to pull out the next time you get a flat tire. Experts suggest saving the equivalent of three to six months' worth of expenses in an emergency fund. This is a great goal to aim for, but you should at the very least be able to handle an unexpected expense in the $500-$1,000 range before you start investing.

To sum it up, investing in the stock market can be a great idea if you have no credit card debt and a reasonable emergency fund.