Most hairball remedies act to push the hairball through to the intestines so it is not coughed up. This is what all the high fiber hairball foods (usually oat fiber) and canned pumpkin do for them.
When I fed my cat canned pumpkin, I was advised to give 1-2 tablespoons per day. The best brand is Libby's canned pumpkin - you want one with no added sugar, etc.
When labels talk about "preventing" hairballs I believe they are actually referring to preventing the cat from throwing up a hairball, not preventing them from having a hairball. You cannot prevent a cat from eating hair unless he stops grooming himself, or unless you can brush him very well to eliminate as much loose hair as possible. And, even so, it is hard to eliminate ALL loose hair.
I would ask your vet about taking food away - different vets seem to have different opinions on this. I have worked for vets who swear by taking food away for 12 hours after a pet has vomited - others don't feel there is a need. The first vet I worked for never advised this. The vets I work for now sometimes perscribe pepto bismol for upset tummies - but it does contain a salycilate, which are at times dangerous for cats. And this is mostly used for vomiting, but not necessarily for hairballs.
In other words, I would check with your vet. It may not be a bad idea to have him looked at anyhow, as you said he has not been feeling well all day. I always think it is better to err on the side of caution. Especially since you didn't see any hair.
I hope he feels better soon!