Rockets move forward by ejecting combustion gas under high pressure in large quantities and at high speed When you let go of a balloon filled with air, it will fly around as the air forces its way out. The force that moves the balloon is the reaction to the air leaving the balloon. This is called thrust. Thrust operates in the opposite direction to the direction of the air leaving the balloon.
Rockets fly in much the same way.
Rockets generate large amounts of high-pressure combustion gas in their engines, and this gas is ejected rearwards at high speed providing the force that drives the rocket forward. A rocket is equipped with a combustion chamber and a nozzle. The combustion chamber is where gas is generated by burning fuel. Since oxygen is required for burning fuel, and there is no air in space, the rocket must generate its own oxygen. For this, a rocket uses a material called an oxidizer, which must be carried by the rocket in addition to the rocket's fuel.