Oxidation is the gain of oxygen and loss of hydrogen while reduction is the gain of hydrogen and loss of oxygen. The species which gives oxygen or accepts hydrogen is called oxidizing agent whereas the species which gives hydrogen or accepts oxygen is reducing agent.
Here, SO2 is oxidizing agent and H2S is reducing agent.
Here, H2 is reducing agent and O2 is oxidizing agent.