After the market tanked in 2022, it came roaring back last year. The S&P 500 soared 24% in 2023, and it started to hit fresh, all-time highs throughout the month of January this year.

Besides renewed investor optimism, we are still in an uncertain economic environment, with a potential recession on the horizon. So, investors might be wondering if now is still a good time to invest in the stock market.

Here are three questions you need to ask yourself before making a decision.

Is there extra cash lying around?

I believe it's critical to take a step back before you even think about investing in the stock market. The first step should be to take care of your personal financial situation, which might be something that many people are inclined to overlook.

Paying off high-interest debt, like credit cards or personal loans, should be your top priority. These products typically carry extremely high interest rates, at least more than what you could expect to earn in the stock market. Getting rid of this type of debt can also bump up your credit score.

The next step is to put some money aside in a savings account. This so-called emergency fund should be able to cover at least three to six months of expenses, and maybe more, depending on your situation. Having this financial cushion provides a valuable safety net should a negative event happen, like a job loss. The peace of mind it provides is worth it.

Trader pondering while looking at stock charts on monitors.

Image source: Getty Images.

Will I avoid the temptation of trying to time the market?

Seeing the S&P 500 hit new all-time highs seemingly every day can be discouraging for those who have been on the sidelines and have missed the rally. A rational approach might be to wait until the market takes a breather and there is a more attractive entry valuation.

However, there's one glaring issue with this strategy. No one can predict what is going to happen with the stock market in the near term with any sort of consistent accuracy. There are an unlimited number of variables impacting the markets and the economy at any given moment. But it's encouraging that if your time horizon spans many decades, correctly timing the right entry point doesn't matter.

In other words, time in the market is significantly more important than timing the market. And just as important, I'd recommend investors consider dollar-cost averaging. This encourages forming a critical habit like regularly saving and investing.

Can I find attractive investment opportunities?

You've made it this far. Your personal finances are in order, and you have committed to avoid trying to time the market. The next question to figure out is if there are solid investment opportunities out there today.

The popular approach, one that even Warren Buffett raves about, is to go the passive route. There are numerous S&P 500 index funds and exchange-traded funds (ETFs) that provide a low-cost and diversified way to gain exposure to some of the largest and most profitable enterprises. This method has historically produced annual returns of 10% on average.

If you think you have the ability and time to successfully research individual stocks, then it's smart to look at high-quality businesses that possess economic moats and growth potential.

I believe both Etsy and PayPal fit the description. On a forward price-to-earnings (P/E) basis, their valuations are dirt cheap. They both benefit from powerful network effects. Etsy is riding the e-commerce trend, while PayPal gains from the ongoing war on cash. These stocks have the potential to reward investors over the long term.

Taking the time to assess your responses to the three questions above will provide more clarity as to what your next course of action should be.