Kevin O'Leary (also known as Mr. Wonderful) is accustomed to providing input to entrepreneurs on ABC's Shark Tank. But he also doesn't mind sharing his advice with others who will never appear on the popular TV show.

In a recent appearance on Good Morning America, O'Leary answered viewers' questions about investing and personal finance. The Shark Tank star revealed what he thinks is the one thing you need to do to retire with $1.5 million. 

Two people sitting on lounge chairs on the beach with the sun setting.

Image source: Getty Images.

One simple step in the path to $1.5 million

Retiring with $1.5 million might seem to be an impossible goal for some. However, O'Leary thinks that you only have to take one simple step to make it happen.

The successful businessman is a firm believer in 401(k) accounts. The traditional version of the 401(k) allows individuals to save money for retirement on a tax-deferred basis. No taxes are paid on the initial contribution, but later withdrawals during retirement will be taxed. Contributions to a Roth 401(k), on the other hand, will be taxed. However, the money invested will grow tax-free.

Whatever type of 401(k) plan your employer offers, O'Leary recommends contributing at least 15% of your salary to it on a regular basis. He stated on Good Morning America that if you follow this practice, "You'll end up with $1.5 million in the bank after a career."

What Mr. Wonderful recommends

Socking away at least 15% of your salary in a 401(k) won't be easy for every person. Mr. Wonderful shared his recommendation on what to do to free up enough money to save for retirement.

O'Leary stated on GMA: "Stop buying all that crap you don't need. You have to adjust your lifestyle to make sure you put 15% away." While that's certainly blunt advice, it makes sense.

The only way to save is to spend less than you make. Most Americans have more control over how much they spend than they do over how much income they earn. Cutting back unnecessary expenses can help boost the amount of money available for saving for retirement.

Another smart move to make that O'Leary didn't mention is to take advantage of a 401(k) company match if your employer offers one. Many employers will match what you contribute to your 401(k) plan, either on a percentage or dollar-for-dollar basis -- usually up to a maximum threshold. This is basically "free money" that can help tremendously in saving for retirement.

Is O'Leary right?

Can simply investing 15% in a 401(k) really help you to retire with $1.5 million, as O'Leary suggests? Maybe.

It's important to note that the Shark Tank star said the goal of $1.5 million could be attained "after a career." Time is a critical element when it comes to saving for retirement. The sooner you start, the more your money will grow.

The amount of your salary is also obviously a key factor. Accumulating $1.5 million over time by saving 15% of an annual salary of $100,000 is an easier goal than doing so with an annual salary of $30,000. 

Where you invest your 401(k) contributions matters, too. Some assets tend to perform better over the long run than others do. 

But O'Leary is definitely on to something. A person who contributes $850 per month to a 401(k) plan over a career of 35 years and makes a return of 7% could amass around $1.5 million in retirement savings.

Even if you can't save that much, the discipline of contributing regularly to a tax-advantaged account can help you retire comfortably. In this case, Mr. Wonderful's advice actually is pretty wonderful.