It's pretty fair to say that 2022 was a miserable year for the stock market. All major indexes closed out the year in the red, and many investors are now seeing major losses in their portfolios compared to a year ago.

But things aren't all bleak. And while the stock market may have slumped in 2022, investors may get to enjoy a robust recovery in 2023.

Now, this isn't to say that a 2023 bull market is guaranteed. But it could happen. Historically, some of the stock market's strongest periods of performance have followed extended downturns. So it's a good idea to gear up for a bull market, and you can do so by doing these four things.

A smiling person at a laptop.

Image source: Getty Images.

1. Keep investments that have underperformed

You may have noticed that a lot of your stocks lost value in 2022. But unless you have a reason to believe that they can't recover, your best bet is to hang on to those poor performers and wait for them to gain value.

The tech sector, for example, took a nosedive in 2022. And part of the reason is that some of those companies may have been overvalued in the first place. But rather than dump your tech stocks to free up cash and space in your portfolio, wait for the market to recover and see what happens.

2. Scoop up bargain stocks while you can

Right now, there are many solid businesses whose stocks are trading at a discount. It pays to seize that opportunity and add those companies to your portfolio before a bull market takes hold and they become more expensive.

Think about the stocks on your wish list, and consider taking the leap now, while prices are lower. At the same time, though, put money into stocks that lend to more diversity in your portfolio.

3. Load up on index funds

The beauty of index funds is that they make it possible to own a piece of many different companies with a single investment -- one that doesn't tend to come with hefty fees. If you're not sure which sector of the market to dabble in ahead of a bull run, index funds are a solid bet.

4. Commit to a steady schedule

Although bull markets are a good thing, they can mess with investors' heads. You might fall into the trap of, "Is now a bad time to buy because stock values are starting to soar?"

That's why it pays to get into the habit of investing steadily on a preset schedule. It's a strategy known as dollar-cost averaging, and the great thing about it is that it takes emotion and fear out of the equation.

With dollar-cost averaging, you commit to investing money in certain assets at predetermined intervals -- no matter how the market is doing at the time. It's a solid strategy to employ during periods of strong market performance -- and also during bear markets.

We don't know exactly what 2023 has in store for the stock market. But we can hope that things will take a turn for the better -- which is something you should set yourself up to capitalize on.