Press the M key to select the mine tool and highlight the area of which you want your miner to mine. This only works on asteroids. You must have at least one miner, preferably three stars or higher. Mining is usually the second thing to do after making an airlock and life support area.
To gain matter from mining, you need a refinery. This is where asteroid chunks are converted into matter.
Miners may sometimes asphyxiate if they try to travel between asteroids which are too far apart. To alleviate this, only select small groups of asteroids for mining at a time.