Farmed animals are artificially inseminated by humans. The number of animals farmers bring into existence depends on supply and demand. As demand decreases, supermarkets and restaurants will order smaller amounts of animal flesh and secretions (meat, dairy, and eggs).
When the demand from restaurants and supermarkets decreases, fewer animals will need to be slaughtered. The slaughterhouses will have to start laying off workers and will eventually close (this is already happening.)
As the slaughterhouses close, it will be more expensive to transport animals from the concentrated animal feeding operations (CAFOs, like feedlots) and those will begin to close. (This is already happening.)
As the feedlots and other CAFOs begin to close, it will become more expensive for the breeding facilities to transport their animals to the remaining finishing facilities, and they, too, will begin to close. The breeders will breed fewer animals into existence until they send their final animals off to the last remaining CAFO, and then they will close.
The last remaining CAFO will send their animals off to the last remaining slaughterhouse, and then they will close.
A few animals may remain on small farms that slaughter the animals themselves. But with the collapse of large-scale animal agriculture, legislatures will likely reconsider subsidies to the animal agriculture industry. The cost of no-longer-subsidized feed will rise, reducing the already small profit margins for small farms, and they will likely cease operation as well. A few of their animals may be sent to sanctuary when they are no longer profitable to keep.