The best way to avoid a grease fire is to not have one. While you are cooking, keep an eye on the oil as it's heating. If you notice smoke, turn down the heat or remove the pot from the burner completely. The oil won't immediately catch fire once it starts smoking, but smoke is a danger sign that it's well on its way to getting there.
If the worst happens and your oil does catch on fire, use the following tips:
1. If the fire is still small enough and contained in one pot, it is safe to put it out yourself. If it is already spreading to other parts of the kitchen, evacuate.
2. Turn off the source of the heat on the stove. Do not try to move the pot because you don't want to accidentally spill or splash the burning oil.
3. Do NOT pour water on the fire! Since oil and water do not mix, pouring water can cause the oil to splash and spread the fire even worse. In fact, the vaporizing water can also carry grease particles in it, which can also spread the fire.
4. Remove all oxygen from the flame. You can cover with another pot or pan. Do not cover it with a glass lid because the glass lid may shatter.
5. If you can't cover it, dump lots of baking soda on it.
6. Use a chemical fire extinguisher on the grease fire. There are different kinds of extinguishers. Not all can be used on a grease fire, but the ABC dry chemical extinguisher is best.
Hopefully you'll never be in a situation where you have to actually use this advice, but if you are remember to smother the fire with a pot or baking soda and never use water!