Deku Babas are carnivorous plants that appear from the ground when the area around it is disturbed. If you do not intend on getting hurt, then steer clear of them, because although they are anchored to the ground, they will reach out and bite you if you are close enough. The only way one can die is if it's stem is cut. It is best to stun them with a few hits first, then slash them away once they are vulnerable. There is also a variety that can survive it's stalk being cut, but they can easily be brought down with a few more slashes. When defeated, they often will leave behind useful objects, such as Deku Sticks, or Deku Nuts, or even Deku Seeds.
In Skyward Sword, Link can't kill a Deku Baba by simply slashing at its stem. In order to severe a Deku Baba apart, Link must slash horizontally or vertically, depending on how the Deku Baba's mouth is slanted. Correctly slicing To match the Deku Baba's mouth will defeat it. Striking in an incorrect fashion will fling the Deku Baba's head backwards but not inflict any damage. Link may also perform a shield bash to paralyze a Deku Baba for a short period of time, allowing Link more then enough time to finish it off.