How do you separate a mineral from a rock?

That depends on what kind of mineral and what kind of rock.

If there is a difference between the density, i.e. the weight, of the mineral and rock, then you finely crush the rock and use 'flotation'. (panning for gold) This is using water to which you have added a chemical that gives the water an oily foamy top, a bit like a bubble bath. The crushed rock is added to the water and churned. In the end, the lighter parts cling to the foam at the top and can be skimmed off and the heavier parts sink to the bottom. (refineing copper)

Another way is by chemical separation. for example, if you have a mineral embedded in limestone, you can use hydrochloric acid to disolve the limestone and flush it away.

(PS: I'm a mining engineer.)

Many ores are the oxide of metal (iron ore for example) The metal can be reduced (separated from the oxygen) by copious heat. Most common metals can be obtained in this way. Aluminum (from the ore bauxite) is separated from its oxygen electrically in a great big bath of molten ore. Some metals can be reduced by having their oxygen stolen away by another metal that likes oxygen more.