Soft cheeses, such as cottage cheese, cream cheese and ricotta, with mould should be discarded. The same goes for any kind of cheese that's shredded, crumbled or sliced. With these cheeses, the mould can send threads throughout the cheese contaminating more than you see. In addition, harmful bacteria, such as listeria, Brucellosis, salmonella and E. coli, can grow along with the mould. Although brucellosis can make you very sick, it is rarely fatal. It's a bacterial infection that spreads from animals to people. Most commonly, people are infected by eating raw or unpasteurised dairy products.
Mould generally cannot penetrate far into hard and semi-soft cheeses, such as cheddar, Parmesan and Swiss. Therefore you can cut away the mouldy part and eat the rest of the cheese. Cut off at least one inch around and below the mouldy spot. Be sure to keep the knife out of the mould, so it doesn't contaminate other parts of the cheese.
Of course, not all moulds pose a risk. Some types of mould are used to make cheeses, such as Brie and Camembert. These moulds are safe for healthy adults to eat. However, these cheeses, as well as other soft cheeses and cheeses made with unpasteurized milk, are best avoided by people with weakened immune systems, such as older adults, pregnant women and young children.
If you're not sure what type of cheese you have or what to do if it grows mould, the safe course is to discard it or you can shred it through a cheese grater and feed it to the wild birds. They are far less finicky about their diet.