Do I have to use my mining ship to do it? If so how do I do it with the mining ship?
Yes, you do. Simply send your ship to the asteroid you want to mine, and it will do the rest. When it is finished, it will just sit there, so you'll have to send it to the next one yourself. An easier way to do this is to double-click to highlight the ship and give it the 'automate' command. It will upgrade the asteroid you choose, and when finished, move to the next in line. When you research the next level of tech, it will go through the process again. Be mindful, though. When the ship has finished up to the current level of tech in a particular field, it will take off across the galaxy to the next closest field and start the process again, unless you de-activate the auto command. You can use multiple ships in a field if you are in a particular hurry. When the field is completely built up, the ship becomes redundant, and you can upgrade it to a constructor, and send it off to wherever you need it.
Does that mean they run out?
Not at all. You can milk that cow forever, and they cost you nothing to maintain. Free resources. Did you know that you can choose where to send the resources? By default they will be sent to your nearest planet, but you can direct them to another planet in the system, or even to one in another system entirely- but keep in mind, that the farther away you beam them, the less will actually get there. You can also direct multiple fields at a single planet, for an extra large boost. Hope this has cleared things up for you. Good gaming.