why defecate in black colour

What causes a person defecate become black in colour and how to overcome it!