I am sorry your boy is not feeling well. What you describe is called "The meat loaf" position. It indicates the cat is in pain.
I am not that concerned about the hair ball or one episode of vomiting. However, I am worried about his ability to urinate. Pancreatitis is also possible. If, God forbid, he is unable to urinate that is a medical EMERGENCY where he would need immediate vet care. Pancreatitis, less serious also needs to be seen by a vet.
IF he IS able to urinate and is just nauseated, he can be treated at home.
Give him one quarter of a ten mg pepcid a/c (famotidine). I usually add it to a tablespoon of baby food chicken with no onion or garlic Or canned cat food.Every 12 hours.
Remove all dry food and any wet with chunks, pieces or shreds.
Feed only smooth pate canned food or baby food.
If he gets dehydrated give him tuna water drained from the can.
Please let me know how he is doing .
Please be so kind as to rate my answer with positive feedback; that is the only way I receive credit for my assistance. Thank you very much!
Providing a positive rating will not end our conversation, should you need me for any follow-up. Simply click 'Reply' for clarification or additional information, if needed, at no additional charge.