There are many cases of animals killing themselves, but whether they can be classed as suicides is up for debate. Suicide is considered to be the act of killing oneself intentionally, but it is difficult to know if an animal knows its actions will result in its own death. For example, there have been cases of dogs becoming depressed and stopping eating when their owner dies, or distressed whales beaching themselves, but they may not be aware that these actions will end their lives.
Other creatures appear to sacrifice themselves for the good of the species, such as the exploding ants that destroy themselves and the enemy when threatened, or the female spiders that allow their young to eat them. However, it is likely that these are simply natural responses to environmental triggers, rather than conscious decisions to die. Meanwhile other animals are simply made to kill themselves, as parasites infect their minds and alter their behaviours, steering them towards certain death.