Occasional hairballs with your cat are generally nothing to worry about, though it can help to recognize when they are attempting to rid themselves of a hairball. Hairball control for cats tends to be the 'cough-gag-retch' sound, followed by a hairball. However if you notice that your cat seems to be doing this every few weeks, or if they are retching for longer than 48 hours with no success, it is worth seeking a hairball remedy to help them clear the hairballs away.
Your lovely kitty may be over-grooming, which is common in cats that experience an irritating skin condition, this can be the result of an allergy to something, and so if they seem to be grooming excessively or have any bald spots, it would best to approach your veterinarian to check for allergies.