This is a pretty hard one if you're a newcomer to accounting...
The book value of equipment is equal to historical cost minus accumulated depreciation.
The historical cost in this case is $10M, so we know that the company must have recognized $4M of depreciation in order for the equipment to have a book value of $6M (they are depreciating the equipment over 5 years with no salvage value).
When you sell the equipment, you're going to credit the acquisition cost for $10M and debit accumulated depreciation for $4M. That is the proper way to "retire" the asset from your books. The rest of the journal entry will depend on what you're getting in exchange for the equipment.