The S&P 500 has officially entered a new bull market after surpassing its previous all-time high last week. After a tumultuous couple of years, many investors are feeling optimistic about the stock market again.

While it can be tempting to rush out and buy equities, it's critical to invest carefully right now. Investing in the wrong places could be incredibly costly, but with the right strategy, you can take full advantage of this market surge.

Everyone's approach to investing will be slightly different, but there are three moves to make right now that can set you up for success in this new bull market.

Bull figurine with stock market chart in the background.

Image source: Getty Images.

1. Set your sights on new investments

With stock prices on the rise, now is a great time to add new stocks to your portfolio. While there are never any guarantees that the market will continue its upward trajectory, investing during the early stages of a bull market can help maximize your returns over time.

This is also a good time to take stock of your current portfolio and double-check that all of your investments deserve to be there. If any of your stocks no longer fit your goals, now could be a good time to sell, as prices are higher than they were a few months ago.

2. Keep a clear head

Bull markets are exciting, especially when the last couple of years have been rough. But it's more important than ever to ensure you're investing in the right places.

Even shaky stocks can perform well when the market is thriving, but those companies will have a harder time recovering from periods of volatility. If you invest in the wrong stocks now, it could seriously cost you down the road.

While there's no single correct way to invest, the best stocks are from companies with solid underlying business fundamentals -- which include everything from healthy financials to a competitive advantage to a competent leadership team. These stocks will still experience short-term ups and downs but are far more likely to see consistent growth over time.

Investing in individual stocks requires a fair amount of time and research and won't be the right approach for everyone. If you're looking for a lower-effort way to invest, low-cost index funds (such as an S&P 500 index fund) can be a better option. This type of investment tracks a particular index, like the S&P 500, and all of the stocks are already chosen for you. This takes much of the research and guesswork out of investing.

3. Do your best to maintain a long-term outlook

Past performance isn't indicative of future returns, so even though the market has been surging in recent months, that doesn't necessarily mean it will continue that way. But even if stock prices take a turn for the worse, the market's long-term track record is still impeccable.

Historically, the market has been able to recover from every single downturn it's ever faced. Nobody knows what stock prices will do in the coming months, but if the market becomes volatile, do your best to maintain a long-term outlook.

^SPX Chart

^SPX data by YCharts.

One strategy to help avoid getting caught up in the market's short-term fluctuations is called dollar-cost averaging and involves investing at regular intervals throughout the year. Sometimes, you'll invest when prices are high, while other times, you'll buy at a discount. Over time, those highs and lows should average out.

Dollar-cost averaging can help take some of the anxiety out of investing as you don't need to worry about buying at just the right time. If stock prices fall, keep investing consistently and wait for the inevitable recovery.

This new bull market is exciting, but it's important to have a strategy in place. By investing in the right places and keeping a long-term outlook, you can maximize your earnings while keeping your money as safe as possible.