If you want to save for your retirement, investing in stocks is a good way to accomplish that. Some stocks are risky, and it can be easy to lose money. But it's also easy to make money, even if you're not sure what to invest in.

The key thing is to invest on an ongoing basis. This way, you can build up your portfolio over time, putting yourself in a good position when it's time to retire. By doing so, you can avoid making the costly mistake that many people regret in their later years.

A majority of Gen Xers wish they had saved more

According to a recent study from life insurance company Allianz, 55% of Generation X investors say they regret not saving more money for retirement. Although they're still in their 40s and 50s and have many investing years left, it becomes more challenging to invest and save for retirement at a later age.

The advantage of starting earlier in life is that you don't need to put aside a lot of money each month to build a big portfolio. If you wait until later in life your monthly contribution needs to be much higher -- and then you may still not achieve your goals.

Investors who started early will feel less stressed when they're within 10 or 20 years of retirement, as they won't be as worried that they didn't set aside enough money to retire comfortably.

An easy strategy for avoiding this regret

A good strategy for young investors is to put money every month into an exchange-traded fund (ETF). This can give your investments some diversification and solid growth opportunities to cash in on. If you invest early on, you can afford to take on a bit more risk because you'll have time on your side. In the long run, quality growth stocks will rise.

One ETF that may be ideal for growth is the iShares U.S. Technology ETF (IYW -1.49%). As the name implies, the fund gives you exposure to U.S. stocks in the tech sector. These include software and hardware companies, and stocks involved with artificial intelligence.

The top three names in the fund are Apple, Microsoft, and Nvidia. Together, they account for approximately 45% of the portfolio's overall weight.

There are a total of 140 stocks in the fund. While this ETF may be heavily loaded toward those three behemoths, it also provides a good deal of diversification. Therefore, it can be an option for young investors looking to make the most of their money.

In 10 years, the fund dwarfed the S&P 500 and its 243% total returns (which include dividends). During that same period, the U.S. Technology ETF has skyrocketed by around 590%. That means if you invested $10,000 in the fund 10 years ago, your investment would now be worth nearly $70,000, versus only $34,000 if you mirrored the S&P 500.

While tech stocks may look a bit expensive these days, investing in a growth-focused fund, such as this technology ETF, can be a great way to maximize your returns in the long run. The ETF has an expense ratio of 0.4% which is competitive and comparable to other diverse funds.

Buy and hold and keep investing

Regardless of how much you can afford to invest, trying to put money regularly into this type of ETF can be a way to ensure that you're always making the most of your savings. It can also be a great place in which to invest tax refunds, which can help bolster your portfolio's returns even more.

Building up the discipline to save and invest regularly can help you avoid a situation where you regret not saving and investing more money. By investing early and often, you can put yourself in a great position to retire comfortably.