In more than 30 years of investing, Jim Cramer has picked up a lot of tricks of the trade to share. His goal is for investors to learn these rules and apply them without even thinking about it, just as he does. And while sometimes having discipline drives him nuts, it is the best portfolio protection out there on days when the market takes a nosedive.

One important rule for Cramer is to distinguish between when to buy a company's shares long after it has had a run and when to recognize a value trap.

When Jim Cramer first started out in trading, he didn't like rules. No one likes rules! His view was that either they couldn't really help, or they would cut his upside and prevent him from making more money. Over time, and after getting burned too many times, he learned the value of discipline.

"The rules protect you against your own bad judgment about what's going on at the companies you own or what's happening in the market overall," the "Mad Money" host said.

In order to really make money in the market these days, investors need discipline. Mistakes can be costly in trading, but if you do nothing with your money, you will have a whole lot of nothing to show for it.

So what is the magic trick to bail you out of a bad situation?

"Discipline trumps conviction," he added.

Find your own form of discipline to make sure you are watching your stocks and have a game plan for when things go wrong. For instance, Cramer has a system of ranking his stocks when things are good, so this way he can hedge himself when they go awry.

He also thinks it is important to be willing to "circle the wagons" on a few high-quality stocks, and be willing to buy them when they are down so you can get a better average price for your earnings.

Rafe Swan | Getty Images

Investment portfolio

Cramer used to think about his rules of investing all of the time when he was managing money, but eventually they became second nature to him. He often finds that he digs into his rule archive to answer the many questions people ask him on a daily basis.

A typical question that an investor will ask is what to do with a stock after it has had a hideous decline. The first response that Cramer will give is to ask why they bought the stock in the first place.

Why does he ask that? Because one of his cardinal rules is to never turn a trade into an investment. If there is one thing he wants investors to take away from "Mad Money," it is to never confuse these two concepts.

If you bought it for investment purposes, that could mean you should buy more. If you bought it for trading purposes, then that means you were waiting for a specific event to occur and should only buy it once.

"What's the worst thing that can happen? The answer, of course, is plenty, and almost all of it bad," Cramer said.

So, don't fool yourself. If you know you purchased something for the purpose of trading, cut your losses quickly when it starts to go awry. Sure, there might be a time here and there where you could turn it into a long-term trade. But most of the time, you'll be on the wrong side of that bet.

Amr Abdallah Dalsh | Reuters

However, much to his surprise, Cramer finds that a lot of people aren't prepared when a correction occurs in the market. They are charmed into the market when things are good and then unprepared when things get bad. They assume that a correction means that something is wrong and that stocks shouldn't be touched.

"That is a very big mistake. Corrections happen all of the time after big runs, and they are to be anticipated, but you can't write off the market when they happen," the "Mad Money" host said.

Another mistake that Cramer sees commonly is that many believe they are supposed to be fully invested at all times. He has even met money managers who think they are supposed to have all their money invested.

This is complete nonsense!

Having cash on hand when the market corrects is the key to protecting your portfolio because sometimes the market will stink and there is nothing to do but just sit in cash.

"In fact, one of the chief reasons that I outperformed pretty much every manager in the business during my 14-year run as a professional money manager is that there were substantial blocks of time when I was largely in cash," Cramer said.

Cash is the perfect hedge in an environment when the market hits dangerous highs and could protect from devastating losses.

Cramer considers cash to be the most underrated investment of all. Whenever he sees the market spike, he starts to sell a little and trim here and there to build up a supply of cash. He sells on strength and buys on weakness.

Otherwise, Cramer fears that investors could wind up selling their best stocks just to hang onto their worst stocks because the higher-quality stocks stopped going up — a big mistake.