The basic idea is to estimate the trend component, by smoothing the data or by fitting a regression model, and then estimate the seasonal component, by averaging
the de-trended seasonal data points (e.g., the December seasonal effect comes from the data points for all Decembers in the series).