An earth quake can happen anywhere and anytime. Clearly they are most likely near faults, but prediction that a major quake is likely sometime in the next 50 years is not much use. A few faults seem to be regular; quakes had occurred in California every 22 years but that was expected in 1989 has still not come. Short term prediction is notoriously very difficult. A small isolated quake looks like the foreshock to a major one. In 1975, observations of natural phenomena in China led to a successful prediction and many lives were saved, but a year later another Chinese quake killed 240,000. Accurate predictions only give a warning of seconds; sensors can raise the alarm at the speed of light, while shock waves take longer to travel; that may be enough to stop trains and lifts, save computer data and stop pumping dangerous chemicals.
No one can prevent an earth quake from happening, but water pumped into boreholes can lubricate a fault, thus reducing friction and releasing stress. This could still result in damage, however, with expensive legal consequences, and is an option not without its own risk.
The way a building is constructed can reduce potential damage by earthquakes. Houses made of adobe and inadequately reinforced concrete can fall easily with great loss of life, especially if built on soft sediments. Modern earthquake resistant buildings are stiffened or built on rubber bearings to dampen out vibrations. Some Japanese buildings have active systems that move weights to cancel out the effects of seismic shock waves.