Have Cat Questions? Ask a Cat Vet Online.
You should be very worried. Any time that a cat won't eat or vomits for more than 48 hours, you are in serious trouble. Their liver can fail and then the cat can die. It is called hepatic lipidosis where the liver thinks it is being starved and starts "grabbing" fat cells...and actually ends up killing the liver.
I suggest that you see the vet first thing tomorrow for a full exam and possibly bloodwork to find out what's going on.
The most common cause of what you are seeing is intestinal parasites. If you have not seen the vet for a fecal exam, I suggest that you take a sample by the vet tomorrow for him to analyze and rule this out (or in). Most vet's won't charge for an office visit if you do this.
Let me know if you still have questions.
Since he is also throwing up hairballs, I would be very worried that the cat has an intestinal obstruction (from the hair) that is causing his illness. In this case, it can be fatal.
I suggest that you ask the vet if you can pay half up front and leave a post dated check for the rest. Some vets will accept this.
Don't forget to accept my answer if it was helpful to you.