Summarize:

If your cat suddenly stops eating, pay attention, particularly if it lasts for more than a day. That's a sign your cat needs to go to the vet to help determine what's wrong. Not eating could be a sign your cat's digestive system is blocked by a hairball. If your cat is continually hacking but not producing anything, that could be a sign your cat has a blockage in its digestive system. Pay particular attention if your cat hacks without production several times in one day.  You should also check to see if your cat is defecating. If it's not, then it definitely has a blockage and needs to be seen by a vet. Alternatively, your cat may have diarrhea because it can't get much around the blockage. Place your hand on the cat's stomach. If it feels harder than normal, that could indicate a blockage. Your cat may also seem really lethargic, like it doesn't have the energy to do much.
Watch for loss of appetite. Notice if your cat hacks without bringing up a hairball. Check the cat's stomach and energy levels.