Earthquakes cannot be predicted, but they have some patterns. Sometimes foreshocks precede quakes, though they look just like ordinary quakes. But every large event has a cluster of smaller aftershocks, which follow well-known statistics and can be forecasted.
Plate tectonics successfully explains where earthquakes are likely to occur. Given good geologic mapping and a long history of observations, quakes can be forecasted in a general sense, and hazard maps can be made showing what degree of shaking a given place can expect over the average life of a building.
Seismologists are making and testing theories of earthquake prediction. Experimental forecasts are beginning to show modest but significant success at pointing out impending seismicity over periods of months. These scientific triumphs are many years from practical use.