A rocket in its simplest form is a chamber enclosing a gas under pressure. A small opening at one end of the chamber allows the gas to escape, and in doing so provides a thrust that propels the rocket in the opposite direction. A good example of this is a balloon. Air inside a balloon is compressed by the balloon's rubber walls. The air pushes back so that the forces on each side are balanced. When the nozzle is released, air escapes through it and the balloon is propelled in the opposite direction.
With space rockets, the gas is produced by burning propellants that can be solid or liquid in form or a combination of the two.