They communicate through vocalizations and body posture/movement.
If you listen to a cat meow, you'll notice subtle differences depending on what they want. I've had so many cats through the years, I know what they want by the meow.
Purring is used for showing contentment, although some cats will purr if they're sick/injured. You'd have to look that one up because I can't remember why they purr when not in a good mood.
Two of the most common body postures are the "scared" cat (with back up and hair raised) and showing their belly (submissiveness). There are so many others, I can't list them all.
Each cat is different, so you have to learn how they communicate with you, other people, and animals by observation.