Since ships on a long trip might carry livestock, they might also have a butcher on board. If not, the task of killing an animal would often fall to the cook or maybe a member of the crew able to perform it.
Aboard the Obra Dinn
The Obra Dinn carried an Irish butcher named Emil O'Farrell, who was called upon to slaughter at least one cow during the voyage. He most likely had his way with the other livestock aboard the ship, including goats, pigs, and chickens, as they slowly deplete over the course of the voyage. He did not survive the trip.