The first step would be to create an electromagnet. You can create an electromagnet by winding a copper wire around the nail, the connect both ends to the battery. A current would start flowing around the nail through the wire, creating an electromagnet with its own magnetic field. Next, bringing the electromagnet to the mixture of copper and iron would slowly attract the pieces of iron (as copper is weakly magnetic). Do this slowly and the iron pieces would all slowly be separated from the copper pieces.