Sounds like you got lucky on this one, as bad as it sounds, you were lucky indeed. I've seen worse fires start from less.
I don't advocate smacking an extingisher on the ground before you use it. Turning it upside down and shaking it once a month should be plenty. If you purchase a cheap one, plastic nozzle, it can not be serviced and has to be discarded after use. You can buy a decent one at any hardware store or DIY center. An ABC extingisher generally works for any home or garage.
You can have as big an extingisher as you want, but size does not matter if you can't use it properly.
If you have any doubts about using it, DON'T, get out and STAY OUT. Call your local FD or 911
If you feel comfortable using it, be calm.
Grab the pin and pull it, take the hose in one hand (generally the left.....right handed people) and grab the handle with the other.
Before you approach the fire, give the handle a quick burst to make sure it works properly.
Approach the fire, till you feel the heat, aim at the base of the fire and squeeze the handle and sweep the hose across the fire.
Once the fire is out, or the extingisher is empty, back away from the fire, DO NOT turn your back on the fire.
Call your local fire dept or 911
These are the instructions we give when we put on a fire extingisher demostration.
If you have any questions about using an extingisher, contact your local FD. They may offer some classes on extingisher usage.