Charles Richter's observation that 'only fools and charlatans predict earthquakes,' reflects the fact that despite more than 100 years of effort, seismologists remain unable to do so with reliable and accurate results. Meaningful prediction involves specifying the location, time, and size of an earthquake before it occurs to greater precision than expected purely by chance from the known statistics of earthquakes in an area. In this context, 'forecasting' implies a prediction with a specification of a probability of the time, location, and magnitude. Two general approaches have been used. In one, the rate of motion accumulating across faults and the amount of slip in past earthquakes is used to infer where and when future earthquakes will occur and the shaking that would be expected. Because the intervals between earthquakes are highly variable, these long-term forecasts are accurate to no better than a hundred years. They are thus valuable for earthquake hazard mitigation, given the long lives of structures, but have clear limitations. The second approach is to identify potentially observable changes in the Earth that precede earthquakes. Various precursors have been suggested, and may have been real in certain cases, but none have yet proved to be a general feature preceding all earthquakes or to stand out convincingly from the normal variability of the Earth's behavior. However, new types of data, models, and computational power may provide avenues for progress using machine learning that were not previously available. At present, it is unclear whether deterministic earthquake prediction is possible. The frustrations of this search have led to the observation that (echoing Yogi Berra) 'it is difficult to predict earthquakes, especially before they happen.' However, because success would be of enormous societal benefit, the search for methods of earthquake prediction and forecasting will likely continue. In this review, we note that the focus is on anticipating the earthquake rupture before it occurs, rather than characterizing it rapidly just after it occurs. The latter is the domain of earthquake early warning, which we do not treat in detail here, although we include a short discussion in the machine learning section at the end., (© 2021 IOP Publishing Ltd.)