In the majority of cases nanostructures prepared by focused electron beam induced deposition (FEBID) employing an organometallic precursor contain predominantly carbon-based ligand dissociation products. This is unfortunate with regard to using this high-resolution direct-write approach for the preparation of nanostructures for various fields, such as mesoscopic physics, micromagnetism, electronic correlations, spin-dependent transport and numerous applications. Here we present an in-situ cleaning approach to obtain pure Co-FEBID nanostructures. The purification procedure lies in the exposure of heated samples to a H$_2$ atmosphere in conjunction with the irradiation by low-energy electrons. The key finding is that the combination of annealing at $300^circ$C, H$_2$ exposure and electron irradiation leads to compact, carbon- and oxygen free Co layers down to a thickness of about 20,nm starting from as-deposited Co-FEBID structures. In addition to this, in temperature-dependent electrical resistance measurements on post-processed samples we find a typical metallic behavior. In low-temperature magneto-resistance and Hall effect measurements we observe ferromagnetic behavior.