What is the meaning of [Nip something in the bud]

To stop a bad situation from becoming worse by taking action at an early stage of its development. “When the kid shows the first signs of misbehaving, you should nip that bad behavior in the bud.”