Picture this. After midnight, many grocers drop the price on certain unsold items. Cuban, savvy as always, is there, ready to take advantage of this little-known opportunity.

Long before he earned his first billion, Dallas Mavericks owner and “shark,” Mark Cuban took every opportunity to conserve cash.

“I used to go to the grocery store at midnight because they lowered the price of chicken and these big [bags of] French fries to $1.29,” he told Bill Maher on an episode of Club Random in December 2022.

“And I would buy a bunch of them.”

But Cuban’s financial success wasn’t just about picking up discounted chicken breasts at a grocer.

It’s not so much what you spend as it’s the “opportunity costs” of spending it

Cuban has always had a knack for not just saving money, but spending it in the most prudent way. A good deal is a good deal, but is it the best deal?

He swears by a concept called “opportunity costs.” In other words, what are you giving up when you decide on an investment?

And he’s not the only one.

If you ask one of the world's most prolific investors, Warren Buffett’s second-hand man, Charlie Munger, he’ll likely say Cuban is a smart guy. After all, according to Munger, “Intelligent people make decisions based on opportunity costs.”

So what exactly are opportunity costs, and how can we apply the concept to improve our financial health?

When we make a financial decision, like purchasing 100 shares of Microsoft (MSFT) in our retirement account, we forgo many other opportunities. Opportunity cost is simply the best alternative.

Perhaps you decided that purchasing an equivalent value of Apple (APPL) shares was the second-best investment choice you could have made. Therefore, assuming you have don’t have unlimited funds, the opportunity cost of purchasing shares of Microsoft (MSFT) is the forgone ability to buy shares of Apple (APPL).

While this may seem obvious, many people don’t internalize this concept, so let’s look at another more glaring example to drive home the point.

Imagine you have $25,000 in free cash available to use. There are nearly limitless ways you could spend this money. Your first thought is to invest the cash in the stock market, perhaps by purchasing shares of the S&P 500 index-tracking ETF, SPY.

It seems like a responsible and prudent decision, but is it?

The other side of the equation

What if you have an outstanding debt of $25,000? And what if this debt incurs a 10% annual interest rate over the next five years? Can you generate 10%+ annual returns from the broad market on average for the next half-decade?

Instead of buying the ETF, you could use the cash today to pay off the loan, essentially guaranteeing yourself a 10% return.

Again, guaranteed return is the keyword. With the debt, the transaction is known ahead of time. With the stock market, the returns could be below 10% annually, or less, or even negative.

“Whatever interest rate you have — it might be a student loan with a 7% interest rate — if you pay off that loan, you’re making 7%. That’s your immediate return, which is a lot safer than trying to pick a stock or trying to pick real estate, or whatever it may be,” Mark Cuban says.

Sadly, opportunity cost is a theoretical concept that doesn’t excite most people’s interest. But it can be a game changer for those who do leverage its analytical prowess.

Take stock

Understanding the concept of opportunity cost doesn’t guarantee financial freedom, but it can provide a powerful tool that some of the most successful people leverage.

Next time you decide to make a large purchase on credit that charges 20%+ in annual interest, consider your options.

Do you have some stocks you can sell instead of taking on credit? Do you think these stocks can appreciate at a rate higher than you’ll be charged interest on the credit?

If yes, the credit card purchase makes sense. If not, perhaps it’s prudent to consider selling some shares.

It doesn’t have to be large purchases—and it doesn't necessarily have to be financially focused either. You can start applying this framework in other areas of your life.

Only have a caloric budget for one dessert today? Then skip that donut you were offered at the morning conference. It’s a jelly donut, you’re more of a Boston cream person.

You don’t want to have to forgo that cherished after dinner bowl of mint chocolate chip ice cream. “Donut? No, I’m good, thanks.”