This will depend on the nature of the hazard and how much time and space you have. Your riding skills should be second nature to you. Even the best decision is meaningless if you do not have the skills to carry it out. Know your limits and ride within them. The best way to stay out of trouble is to see it coming.
Experienced riders make a practice of looking well ahead.
In the city, they are always looking from one-half to a full block ahead. On the highway, they look about as far ahead as they can see clearly, giving themselves plenty of time to adjust to problems. They avoid panic stops or sudden swerves that can cause even more trouble. Keep checking the road surface ahead for slippery spots, bad bumps, broken pavement, loose gravel, wet leaves, or objects lying in the road. Curves and ramps are known collectors of oil and gravel.