you mine them from asteroids using your survival tool (via left click). Or you could just place a mining drill somewhere.