First, all cats groom themselves and swallow some hair – unfortunately, some cat’s stomach motions are not strong enough to force accumulated hair out naturally. This hair has to go somewhere, thus, a coughed up hairball.
The easy answer is giving your cat a mild laxative to help the hair pass.
Your vet has two or three of these type medications. I like to have clients try something they already have at home – Vaseline jelly. Apply a small amount of Vaseline daily to the top of the front paws or the tip of the nose. Most cats lick the jelly, which makes dosing easy.
Some cats require daily treatment and others just twice a week to stop the hairball problems.