The safest response will depend on the circumstances around the hazard such as road conditions, weather, the limitations of your bike, and your skill as a rider.
Try to anticipate the potential hazards or traffic that would normally make you brake.
Learning to identify hazards early will give you more time use that information, decide what to do and act on it.
As I approached one of many rural corners we have here in Devon, I was confronted by a very large tractor with some form of pointed agricultural spikes on the front
This Driving Standards Agency scheme can not only help with rusty riders but help you develop skills you already have. It may also help reduce your motorcycle insurance
Cornering on a bike is very different from cornering in a car