For slightly matted fur use a brush specifically for the task like a shedding brush. If the fur is really mattted, just trim it carefully with scissors.
Try to work out the fur mat with your fingers. Pull out the manicure scissors if that doesn't work. Snip down the middle of the fur mat, far from the skin. It's quite easy to snip the skin accidentally on longhaired cats, so work carefully.
Bring the cat to a professional groomer if the cat is unapproachable, if the fur mat is in a delicate area or if the mats are extremely tangled. Then upgrade to a dog.