It works on Newton's Third Law of Motion "Every action has an equal and opposite reaction"
So when the rocket fuel is burnt it produces a certain amount of thrust downwards from the rocket's propellers(not exactly a propeller more of a nozzle and an exhaust) in the form of that huge amount of gas and fire we see
This produces thrust on the ground at say x Newtons
Since every action has an equal and opposite reaction, the ground exerts an equal force in the opposite direction propelling the rocket upwards
And that's how it works