The working of a rocket is based on the principle of conservation of momentum as in the absence of external forces, the total momentum of the system remains conserved. Here, just before launching, the momentum of the rocket is zero and after the rocket is fired it forces a jet of hot gases with a high velocity. This results the jet of gases acquiring a momentum downwards. Therefore, the rocket acquires a momentum of equal magnitude in opposite direction which causes the rocket moving upward.