Wildfires spread quickly, and there's not always enough time to get to safety without encountering the fire. If you're stuck outside, try to find a clearing where there aren't a lot of trees and branches to fuel the fire. If you're on a mountain, the windward side is usually safer because it's not as dry. Cover your nose and mouth to minimize smoke inhalation and stay put until the fire passes through.
If you're in a car, you're safer than being outside, so don't get out unless it's an absolute emergency. Roll up your windows and close your air vents to help keep out the smoke. Then turn on your lights and drive slowly, but not through heavy smoke. If you get to the point where you have to stop, then you should leave your lights on, get on the floor and cover up with a blanket, coat or whatever you have with you. Stay down until you're sure the fire has passed.