Close the toaster oven door and unplug the cord from the outlet, if you can do so safely.
Pull the pin on the fire extinguisher, if necessary. Aim the extinguisher at the base of the flames, and spray with a sweeping, side-to-side motion.
Toss handfuls of baking soda at the base of the flames if you do not have a fire extinguisher. When heated, baking soda releases carbon dioxide, which will help smother the fire.