normally in a mine the ore thats extracteed is unpure and contains many impurities and so are usually compounds and so must be then processed to form pure elements
some elements can be extracted from a solution of its ions such as magnesium
hope that helps