Possibly, if you're in a business or a farm that uses them for business purposes, like:
- Selling beef
- Selling dairy products
The deduction can be taken
- In the year of sale or slaughter (for resale/feeder cattle)
- Or through depreciation (for breeding/dairy cattle).
Please see the post by @ValerieE
Also see the IRS Fact sheet Reporting Farm Income and Expenses