Your pet will need to eat any meat, won't eat fruit/vegetables, or it will attack when starving. You can feed your pet in the pet menu. Your pet may occasionally eat food off the ground.
You can also give a potion through feeding. If a pet is dead feeding it a health potion will revive it.