Call for help
No matter how much confidence you have in your abilities, you should first inform the emergency service about the situation in your building. The fire might not look much threatening at the start, but it spreads around pretty quickly, so you would want the professionals to come to your aid. Different countries have got different emergency numbers. You can check them from the link: wikipedia.org/wiki/Emergency_telephone_number.
Assess the fire and yourself
Although you will not have much time to think, it is essential to make an assessment of whether you are capable of handling the situation. In order to find that out, you will also be required to assess the fire before deciding to take any action. Try to find out what caused the fire and how serious it is. The fire might have been caused because of a short circuit, gas leakage or some other reason.
Check the type of extinguisher
There are different types of fire extinguishers, known as class A, B, C, D and K. The first three contain a dry chemical, which can deal with any type of fire. The class D extinguisher is used for water reactive metals and is in powderred form whereas the class K extinguishers contain a wet chemical, helpul in putting out kitchen fire caused by cooking oils.
Remember the P.A.S.S rule
You need to keep the acronym P.A.S.S in mind while operating the fire extinguisher. The first thing you need to do is remove the safety pin, then aim at the base of the fire, squeeze the handle to gently release the chemical and then finally sweep the extinguisher side to side until you get the desired result.
Check if more flames are remaining
After you have used the fire extinguisher, you need to watch closely whether all of the flames have been extinguished. If there is still some fire remaining, aim towards it and repeat the above process.
Purchase a new fire extinguisher
Once your purpose has been served, buy a new fire extinguisher immediately, so that you can use it in an emergency situation sometime in the future.