Predicting earthquakes is a very hard problem. What scientists can do is a long-term prognosis: study the fault lines, their motion, pressure and so on. This often gives a prediction like "we expect a magnitude X earthquake within the next years". Those predictions can be quite reliable if the system got enough attention (especially at the US East Coast and in Japan). Pressure builds up slowly until the ground breaks. The trigger of large earthquakes can be very small and therefore hard to predict.
Shakir said:
If only we could know when earthquake was going to hit, how many lives could have been saved!
The regions where earthquakes happen are well known. Just build houses solid enough to withstand those earthquakes. It makes the houses more expensive, but they save lives, and they don't have to be rebuilt after every earthquake.
The 2010 earthquake in Haiti, with magnitude 7.0, killed 100,000 to 200,000.
As comparison, Japan gets hit by about 2 magnitude 7 earthquakes per year - typically with 0 to 5 casualties.
Even the 2011 earthquake, one of the strongest ever recorded, didn't lead to large damage or casualties - at 100 times the energy of a magnitude 7 earthquake. The tsunami did kill many, but that is a different topic.
Building houses properly matters.