When alarmed or threatened, an octopus may squirt out a cloud of inky liquid. The cloud is like a smoke screen and allows an octopus to escape a potential predator. The brown or black cloud is inky because it contains a lot of melanin, a common pigment found in animals to give them color. Humans get their skin color from melanin.
The ink from an octopus may contain some chemicals that harm the smell receptors of animals, but it is not poisonous.