First of all, there are many types of guns. Different types of guns may have different ways to feed the bullet. Generally a revolver uses revolving cylinder mechanism to feed a new bullet after each shot.
There are different components in a revolver.
If you want to fire a bullet you have to pull the trigger , and the mechanism is designed in a way such that , hammer is pushed back which will compress the spring and at the same time the cylinder which hoses bullets in also rotated.
If you pull the trigger all the way back , the leaver inside the trigger will release the hammer and the whole potential energy stored in the spring is now being used to push the hammer forward.
So now hammer will make an impact at the back side of the bullet, which will activate the chemical reaction in the bullet.
Lets see how this chemical reaction makes a bullet run so fast.
A bullet has different components, each component has a different function to perform.
At the back ,there is primer. Function of the primer is to ignite the spark after the impact of hammer.
Then this small spark generated from the impact of the hammer will activate the reaction in the powder propellant. Propellant is a mixture of two compounds.One is fuel and other is oxidizer. This reaction will form a huge volume of gases at very high speed ,which will force the bullet to go out of the gun at very high speed.
In the front ,there is a metal jacket ,which is responsible of the actual damage done by the bullet.
So that's how a gun fires a bullet at very high speed.