No matter what the reason, having a credit or debit card declined puts a knot in your stomach.

Sometimes you know the denial might happen. Maybe you aren't sure if a deposit cleared or a bill had been paid. In other cases, your card gets denied, and you don't know why, which causes an entirely different type of panic.

Having a card denied happens more often than you may think. In fact, a just-released survey from CompareCards.com found that 12% of credit and debit card users had at least one card declined in the past year. That's roughly 26 million people who suffered through having a card turned down, based on the number of Americans who use at least one debit or credit card.

A disorganized pile of credit cards in various colors.

Having a card denied is not always your fault. Image source: Getty Images.

Why are cards being denied?

For 32% of those who had a credit card or debit card denied, the reason was that the account lacked sufficient funds. That number is nearly 40% when you look at just credit card users who had reached their credit limit.

Credit card users were also more likely to experience having their card denied because of the bank's fraud protection program. Almost 3 in10 (28.7%) reported having that problem, while only 16.6% of debit card users experienced having a purchase turned down for that reason.

Trouble ahead?

"Having your card declined can be frustrating and embarrassing, but sometimes [it's] a sign of something more sinister," said Thomas Donaldson, senior credit specialist at CompareCards, in a statement to The Motley Fool. "Whether your card is declined because of fraudulent activity or a simple miscalculation, a few precautions could potentially save you from this hassle."

To avoid fraud, Donaldson recommends setting up a fraud alert on your entire credit file. Doing that gives you peace of mind, because you will be alerted if there are any changes -- like a new account is opened or a loan is taken out -- allowing you to spot problems quickly.

"Fraud alerts are free, and having one on your credit file makes it mandatory for businesses to contact you before issuing any credit in your name," he added.

In addition, fraud alerts are often triggered when your bank notices an out-of-the-ordinary transaction. Some of these can be prevented by letting your bank or card issuer know when you're traveling, especially if you'll be out of the country.

Use common sense

While fraud can be an issue and mistakes happen that cause valid cards to be declined, the most common reason for denial is that people don't understand their own finances. In an era where credit cards and bank accounts can be accessed by app, there's really no excuse for this.

Don't be the person who hands over a card hoping it will be accepted. Know your balances and whether payments or debits have cleared before you get in line. Doing so will save you both embarrassment and time as you either have to find another card or slink out of the store.

If, however, your card gets denied when you do have sufficient funds to pay for the purchase, take immediate action. Call your bank and make sure that the problem is either resolved or that your card gets deactivated before whoever compromised it can do much damage.