If you sell a depreciated asset:
Debit the bank account for the amount you are being paid for it.
Debit the accumulated depreciation account for the amount it has depreciated (this clears out this account)
Credit the asset account for the amount it was previously depreciated (this closes the asset account)
Credit an income account called "Gain on Sale of Asset" (create that account if it is not already created)