A rocket is a vehicle, missile or aircraft which obtains thrust by the reaction to the ejection of fast moving exhaust gas from within a rocket engine. Often the term rocket is also used to mean a rocket engine.
In military terminology, a rocket generally uses solid propellant and is unguided. These rockets can be fired by ground-attack aircraft at fixed targets such as buildings, or can be launched by ground forces at other ground targets. During the Vietnam era, there were also air launched unguided rockets that carried a nuclear payload designed to attack aircraft formations in flight.
A missile, by contrast, can use either solid or liquid propellant, and has a guidance system.
In all rockets the exhaust is formed from propellant which is carried within the rocket prior to its release. Rocket thrust is due to the exhaust gases applying pressure on the inside surfaces of the rocket engine as they accelerate (see Newton's 3rd Law of Motion).
There are many different types of rockets, and a comprehensive list can be found in spacecraft propulsion- they range in size from tiny models that can be purchased at a hobby store, to the enormous Saturn V used for the Apollo program.
Rockets are also used for deceleration, to transfer to a lower-energy orbit, for example to enter into a circular orbit from outside, to de-orbit for landing, for the whole landing if there is no atmosphere (e.g. for landing on the Moon, the rocket of the descent stage of the Apollo Lunar Module was applied), and sometimes to soften a parachute landing.