I will try to answer the actual question posed. Before I do that though, let me make a brief remark. It seems that a lot of people in the comments section are just bickering over what is grammatically correct to say and what isn’t. Please, don’t forget that there is a difference between grammar studied and subsequently prescribed for usage by authoritative grammarians and colloquialisms that are commonplace and know no rules. It’s the latter that people tend to use all the time in daily life because not exactly everybody has majored in English Language and Literature at Harvard University or speaks like the Queen of England. It’s not that it’s bad, it’s just that language in general is not spoken directly from a textbook. And we have no right to blame them for that since the most important utility of human language is communication of thought. If that can be done effectively, the communication process can be considered to have taken place successfully. Thus, if somebody says, “Can I have a water, please?” and everybody around understands perfectly well what they mean–so be it. But, is that a grammatically correct thing to say? According to many of those pesky grammar people, not at all. It’s just like everybody in the U.S. will say “there’s many people down in the lobby” while they should be saying “there are many people down in the lobby.” Once again, there is descriptive grammar–rules and guidelines prescribed by Standard English–and prescriptive grammar–how the average Joe out on the street actually speaks the language. I’d personally go with “Can I have a glass of water?” But that’s beside the point. Anyway, that’s that.
Now, let’s get back to the topic at hand. How do we know when a noun is a mass noun or a count noun? Drawing on my experience with the language, we can’t really say whether it’s one or the other if we see a word for the first time. That apparently holds true even for words that we already know which, I presume, exactly is the problem you have. But we’ll get to that shortly.
Let’s take the word consternation, for example. What is the first thing you would do if you saw this word for the first time? You would look its meaning up in a dictionary, right? But, why? Because you would have no idea what it meant since you had just encountered it. What would you see there? Hopefully, you would see things like what kind of noun it is and a list of meanings the word can take up on. In my dictionary it says that consternation is a mass noun and should always be used as such and that it has only one meaning. They will even have provided a bunch of examples for you which you could use to learn how to actually use the word. Fine, you have just learned a new word and you know that you don’t need any articles in front of it.
For other words in English, the situation can be completely different. For example, the noun failure. This one can be both a mass noun and a count noun. How do we know when to use it as either a mass noun or a count noun? We don’t know that unless we look it up in a dictionary. Here’s a screenshot of the entry for failure in the dictionary I use:

As you can see, there are three basic meanings listed there. And I particularly want to draw your attention to how I just said that because this is very important–three meanings! What this means is that although it is the same exact word, you can think of those three meanings, for all intents and purposes, as constituting three different words altogether that are related, but different in meaning nonetheless. a failure means something slightly different than failure used without an article. This means that they cannot be interchangeable. If you substitute one for another, you’re going to mess up the semantics of your sentence because a failure basically means a loser (well, there are other meanings, but we’ll focus just on this one):
Look at him. He’s forty years old, but he has no job, no car, nothing at all. He’s a total failure!
Whereas failure with no article in front means lack of success:
I’m not used to failure. I just can’t allow myself to fail. So, instead of giving up, I’m going to continue studying hard no matter the cost. And I know I will win.
Do you see that even though the word is the same, depending on the presence of an article, the words semantically mean totally different things? And how do you know that? You use a dictionary!
Every word has its own grammar and context that goes along with it. And this is true for many more words in English. The list literally goes on. A language, for instance, is a bunch of words and syntactical rules that are applied to string them together to convey meaning. There can be many different types of languages: programming languages, spoken languages et cetera. But language is the ability that humans have to communicate with one another phonetically. Do you see how the meaning is slightly different when there is an article and when there is a lack thereof?
That’s how I usually treat mass and count nouns. And my advice to you is you do the same. But at the end of the day, it’s completely up to you how you want to go about learning your English.
To sum things up, each and every noun in English in regards to whether it’s a mass noun or a count noun should be dealt with on a case by case basis. There exist no hard and fast rules as to determining what kind of noun a word belongs to by just looking at it. If you're searching for some kind of mental formula that you could plug things in to tell you if there was a need for an article or not, I'm afraid you're entirely out of luck. There is no such thing. You stumble upon a new noun, open up your trusty dictionary, look it up and learn it.