"Danforth, if I buy a used tractor or a used backhoe or skid steer....how does depreciation work for that equipment?"
Short answer: Whatever you paid for it is your new cost basis, regardless. What they've done before has no bearing on YOUR cost.
Long explanation: Let's say I buy 7- year Equipment for $7,000.
If I'm making enough profit to write all of it off the first year, and still show a profit, I'll do that; it's called expensing. When that happens, my cost basis on that equipment going forward is immediately ZERO. Any sale for profit would be a reportable capital gain.
If, however, "expensing" would either create or increase a net loss, then I MUST depreciate it. $7000, over 7 years.
There are several methods, some with varying amounts, some years higher, some years lower), and one with a fixed amount every year; we'll use that for simplicity. That kind is called Straight Line, and as you'd guess, for a $7K piece of equipment, it's $1000 each year for seven years. At the end of the seventh year, my cost basis would be ZERO.
If after three years, I re-sell it, my Cost Basis in the Equipment is $4,000, since I've already deducted $1,000 a year for three years. If I sell it for $4,500, I've realized a long-term capital gain of $500. Similarly, if I sell for $2,800, I have a capital loss of $1,200, deductible in full, immediately on that fiscal year's tax return.
Now...let's say YOU bought the used equipment. Your cost basis is $2,800, regardless whether I expensed it, or depreciated it. And you've got the same options/requirements as if you'd bought it new, including expensing all of it the first year if you can, or depreciating it via the Depreciation Schedule which suits you best. Straight Line, of course, would be $400/year.
Conclusion: Selling a FULLY DEPRECIATED item isn't rare. But here's the kicker: IT CAN'T BE SOLD TO A RELATED PARTY; that's literally viewed as self-dealing. If it was allowable, you'd be able to buy-and-sell back and forth to the point where you're earning profits where you want, when you want, how you want, and sometimes if you want.