The heat source should be turned off. Baking soda or salt should be poured on it to smother the fire. Class B dry chemical fire extinguisher is a last resort. Don't use water to extinguish the fire.
Let's Get It Fixed!
HomeX virtual experts will assess your issue (for free!) and can resolve simple problems.