The past year hasn't been easy for investors, and if you're feeling nauseated by the stock market's roller coaster of ups and downs, you're not alone.

In recent months, however, stock prices have been on an upward climb. The S&P 500 is up by more than 13% since the beginning of the year, and the Nasdaq has soared by close to 30% in that time.

Some experts are calling this the beginning of a new bull market, but it's unclear whether this upward trend will continue -- especially with economists still predicting that a recession is looming. So is it really safe to invest now? Here's what you need to know.

Should you invest now or wait?

When the market is volatile, it can be tempting to press pause on investing until it's certain things are looking up. However, investing consistently -- even when the market is shaky -- is one of the most effective ways to build wealth over time.

There's still a chance the market may take a turn for the worse later this year, especially if a recession is around the corner. But over the long term, it's extremely likely it will see positive average returns.

For example, say you had invested in an S&P 500 index fund in January 2009, amid the Great Recession. The S&P 500 officially bottomed out in March of that year, so at the time, it may have seemed like one of the worst possible moments to buy.

However, over the following 10 years, as the chart shows, you'd still have earned returns of more than 177%. By today, you'd see returns of close to 400%.

^SPX Chart

^SPX data by YCharts

In other words, it doesn't necessarily matter what the market's doing right now. What matters is how it performs over several years or decades. Even if another downturn is looming, you can still earn a lot of money over time by investing now.

How to keep your money safer

If we do experience a recession or another downturn, not all stocks will be able to bounce back. This means it's critical to ensure you're investing in the right places to keep your money safer.

The best stocks are the ones from companies with solid underlying business fundamentals -- such as a competitive advantage in the industry, a competent leadership team, and healthy financials. These stocks may still hurt in the short term during a downturn, but they're far more likely to recover.

The more of these kinds of stocks you have in your portfolio, the better prepared you'll be for periods of volatility. Regardless of how the market performs in the coming months, the right investments will set you up for long-term gains.

Many investors are feeling conflicted about the market right now, and that's normal. But while it's unclear whether this is really the start of a new bull market, continuing to invest consistently and keeping a long-term outlook can help protect your money -- no matter what the future holds.