Refining is the process of reducing the impurities in a substance. You can't turn crude oil into gasoline without first refining it.
Refining is nowadays most commonly associated with the processing of petroleum products such as oil and gas, but it also applies to precious metals, especially those used in jewelry. Sugar is another substance that undergoes refining, which makes it less grainy and more consistent. Refining can also mean the act of making something more efficient, such as a business process, or clear, such as an idea or argument.