Any unit in the free game C-evo can be integrated into the resource cost of a new unit being produced in the same city - but contributing only two-thirds of its original resource cost, multiplied by the current health of the unit (rounding down fractions). "Z" is the quick key.
The same can apply to buildings, "rebuilding" (a bad translation, which means "recycling") two-thirds of the original material cost of one into a building under construction; but it is more rarely used because few buildings become obsolete in the same way as units do. Click on the building, and you will be invited to "rebuild" it if another is being built, or to sell it (for full value) if no building is in progress.
In each case, any surplus above what is needed to finish the unit or building is likely to be lost.